objstore: enable azure multipart upload#69887
Conversation
|
Skipping CI for Draft Pull Request. |
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Two multipart-writer robustness/consistency fixes surfaced while routing dumpling CSV exports through the concurrent upload path: - GCSWriter.Close only cancelled the multipart upload when finalize failed. A failed part upload or a cancelled context returned early, leaving the initiated upload and its staged parts behind. Close now aborts on every error path via a shared abort helper. - AzureBlobStorage.Create ignored WriterOption, so azblobUploader staged blocks serially regardless of the requested concurrency. It now spawns a worker pool (bounded by Concurrency, chunked by PartSize) that stages blocks in parallel and commits them in submission order. Callers that pass no option keep the original synchronous path. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
fd1462e to
6b5a630
Compare
Replace the hand-rolled worker pool (channel + WaitGroup + atomic error) with an errgroup bounded by SetLimit. Write stays serial so blockIDList keeps file order without locking; the derived context now cancels in-flight StageBlock calls as soon as one fails. No raw goroutines in azblobUploader. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
[FORMAT CHECKER NOTIFICATION] Notice: To remove the For example:
📖 For more info, you can check the "Contribute Code" section in the development guide. |
What problem does this PR solve?
Issue Number: ref #68984
Problem Summary:
While routing dumpling CSV exports through the concurrent object-store upload
path, two multipart-writer issues surfaced in the shared
pkg/objstorewriters:GCS leaves incomplete multipart uploads on failure/cancel.
GCSWriter.Closeonly issued the abort (cancel()) when finalize failed.A failed part upload or a cancelled context stored the error and returned
early, so the initiated upload plus every already-staged part lingered as an
incomplete MPU (billed until a bucket lifecycle rule reaps it). This is
pre-existing shared-writer code, but the CSV export path is the first
dumpling caller to reach it (
Concurrency > 1).Azure never had a concurrent writer.
AzureBlobStorage.CreatediscardedWriterOptionentirely, soazblobUploaderstaged blocks serially no matterthe requested concurrency — while S3 (
asyncWriter) and GCS (GCSWriter)both got concurrent implementations. On Azure the CSV path therefore lost the
old encode/upload overlap with nothing replacing it.
What changed and how does it work?
GCSWriter.Closenow aborts the upload on every error path via a sharedabort(cause)helper that folds any cancel failure into the original cause.The success path is unchanged.
azblobUploadergains a bounded worker pool:CreatereadsWriterOption.Concurrency/PartSizeand, when concurrency is requested,spawns workers that
StageBlockin parallel. Each chunk carries a submissionindex;
Closesorts staged blocks by index beforeCommitBlockListso thecommitted order matches file order. On error it skips the commit (Azure
garbage-collects the uncommitted staged blocks) and surfaces the failure.
Callers passing no option keep the original synchronous path byte-for-byte.
Check List
Tests
Side effects
Documentation
Release note