Skip to content

blob/gcsblob: parallel downloads via driver.DownloaderAt - #3807

Merged
vangent merged 1 commit into
google:masterfrom
stanhu:sh-gcsblob-parallel-download
Nov 1, 2026
Merged

vangent merged 1 commit into
google:masterfrom
stanhu:sh-gcsblob-parallel-download

Conversation

@stanhu

@stanhu stanhu commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Builds on #3805, now merged, which added driver.DownloaderAt and the Bucket.Download routing. Rebased onto master, so this PR contains only its own change.

What

Implements driver.DownloaderAt in gcsblob, so Bucket.Download into an io.WriterAt (e.g. an *os.File) fetches GCS objects with concurrent ranged reads instead of a single stream.

How

Uses cloud.google.com/go/storage/transfermanager, a subpackage of the cloud.google.com/go/storage module gcsblob already depends on, so this adds an import but no new module. It reuses the driver's existing *storage.Client via transfermanager.NewDownloader, queues one DownloadObject writing to the destination io.WriterAt, and returns the first error from WaitAndClose. BeforeRead exposes *transfermanager.DownloadObjectInput / *transfermanager.Downloader.

Part size and concurrency use the transfer manager defaults; a follow-up can thread tunables through once #3806 (the ReaderOptions knobs) lands.

Testing

@vangent

vangent commented Oct 31, 2026

Copy link
Copy Markdown
Collaborator

Please sync now that #3805 is merged.

Implement DownloadAt using cloud.google.com/go/storage/transfermanager,
a subpackage of the storage module this driver already depends on. It
reuses the driver's existing *storage.Client and writes concurrent
ranged reads directly into the io.WriterAt destination.

With this, blob.Bucket.Download into an io.WriterAt (e.g. an *os.File)
fetches GCS objects in parallel instead of on a single stream.

Part of google#3804
@stanhu
stanhu force-pushed the sh-gcsblob-parallel-download branch from a6af3e5 to 67e3ee2 Compare November 1, 2026 06:39
@stanhu
stanhu marked this pull request as ready for review November 1, 2026 06:41
@vangent

vangent commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator

I verified that this works using the drivertest in #3815.

@codecov

codecov Bot commented Nov 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 28 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.28%. Comparing base (5ba0a27) to head (67e3ee2).

Files with missing lines Patch % Lines
blob/gcsblob/gcsblob.go 0.00% 28 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3807      +/-   ##
==========================================
- Coverage   80.46%   80.28%   -0.19%     
==========================================
  Files         104      104              
  Lines       12377    12405      +28     
==========================================
  Hits         9959     9959              
- Misses       2417     2445      +28     
  Partials        1        1              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@vangent
vangent merged commit 8ac9655 into google:master Nov 1, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants