Skip to content

feat(streamingwrites): wire parallel uploads behind the experimental flag - #5290

Draft
PranjalC100 wants to merge 2 commits into
parallel-upload/uwh-abortfrom
parallel-upload/fs-integration
Draft

PranjalC100 wants to merge 2 commits into
parallel-upload/uwh-abortfrom
parallel-upload/fs-integration

Conversation

@PranjalC100

@PranjalC100 PranjalC100 commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

Description

Stacked on #5232. It wires gRPC parallel uploads behind the hidden write.experimental-enable-parallel-upload flag (design: go/gcsfuse-grpc-parallel-upload-v1-integration). One commit per step:

  1. Routing: with the flag, WriteStrategy() returns WriteStrategyParallel for rapid writes on Rapid Cache Ultra buckets (TODO(b/576160379) for GA), and NewWriteHandler returns the unbuffered write handler for it. fs.go needs no logic change, only the ReadFile comment. Adds fs and inode suites for parallel uploads.
  2. bucketHandle: for the parallel strategy, writers from CreateObject and CreateObjectChunkWriter enable parallel uploads. PartSize is write.block-size-mb rounded up to a multiple of 32 MiB; MaxConcurrency is write.max-blocks-per-file (unlimited uses the SDK default). CreateObject aborts the writer when copying fails. CreateObjectChunkWriter drops its chunkSize argument; bucketHandle sets ChunkSize from write.block-size-mb.

Not in this PR: skipping preconditions for parallel uploads (TODO(b/567198348)). The current Go SDK uploads parts as temporary objects and composes them, which RAPID doesn't support (TODO(b/540721232)).

Link to the issue in case of a bug fix.

b/581184469

Testing details

  1. Manual - Negative control: with a Resumable bucket in the new fs suite, 4 of its tests fail, so the suite runs through the unbuffered write handler.
  2. Unit tests - New fs suite TestStreamingWritesParallelUploadTest (15 tests; 10/10 fresh-process runs), inode suite FileStreamingWritesParallelUploadTest, TestNewWriteHandler_RoutesByWriteStrategy, WriteStrategy and lookupBucketType cases, and bucketHandle writer attribute, part size and copy error tests. -race passes for the changed packages, apart from two timing tests in internal/storage that flake on master too. In internal/fs, the new clobber test hits a fake bucket race under -race; the fake fix follows in a separate PR (b/584925513).
  3. Integration tests - NA until the Go SDK supports gRPC parallel uploads (b/540721232).

Any backward incompatible change? If so, please explain.

No. Nothing changes while the hidden flag is off.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces support for parallel uploads on Rapid Cache Ultra (RCU) buckets when rapid writes are enabled. Key changes include routing parallel write strategies to the unbuffered write handler, configuring parallel upload attributes (such as part size and concurrency) on the storage writer, and removing the unused 'chunkSize' parameter from the 'CreateObjectChunkWriter' interface across all bucket implementations. Additionally, the fake object writer was updated to respect context cancellation, and comprehensive unit and integration tests were added to validate parallel upload behaviors. I have no feedback to provide as there are no review comments.

@PranjalC100
PranjalC100 force-pushed the parallel-upload/fs-integration branch from f3b26cc to c7a7c80 Compare November 26, 2026 12:34
…fered write handler

With write.experimental-enable-parallel-upload, BucketType.WriteStrategy()
returns WriteStrategyParallel for rapid writes on Rapid Cache Ultra buckets,
and NewWriteHandler returns the unbuffered write handler for it. The fs and
inode code already goes through the WriteHandler interface for every FUSE
operation, so only the ReadFile comment changes. Adds fs and inode test suites
for parallel uploads.

bucketHandle sets up the parallel upload writers in the next commit. Nothing
changes while the flag is off.
When the bucket's write strategy is parallel, bucketHandle sets
EnableParallelUpload and ParallelUploadConfig on the writers from
CreateObject (staged writes) and CreateObjectChunkWriter (streaming writes):

- PartSize is write.block-size-mb rounded up to a multiple of 32 MiB, with a
  32 MiB minimum.
- MaxConcurrency is write.max-blocks-per-file. Unlimited (-1, rationalized to
  math.MaxInt16) maps to 0, the SDK default.

CreateObject aborts a parallel upload when copying the contents fails, so its
buffers and upload session aren't leaked.

CreateObjectChunkWriter drops its chunkSize argument. bucketHandle sets
ChunkSize from write.block-size-mb, the value the buffered write handler
passed.

Preconditions stay set on parallel upload writers (TODO(b/567198348)).
@PranjalC100
PranjalC100 force-pushed the parallel-upload/fs-integration branch from c7a7c80 to b8fff71 Compare November 30, 2026 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant