Skip to content

blob: configure parallel download defaults via the OpenBucket URL - #3819

Closed
stanhu wants to merge 1 commit into
google:masterfrom
stanhu:sh-blob-download-url-options
Closed

stanhu wants to merge 1 commit into
google:masterfrom
stanhu:sh-blob-download-url-options

Conversation

@stanhu

@stanhu stanhu commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Implements #3818.

What

Adds URL query parameters to set bucket-wide defaults for the parallel-download options, so applications that open buckets by URL can enable and tune parallel downloads without touching Download call sites:

  • allow_parallel_download (bool)
  • download_part_size (bytes)
  • download_concurrency (int)

e.g. s3://bucket?region=us-west-2&allow_parallel_download=true&download_part_size=16777216&download_concurrency=8

Implemented for s3blob, gcsblob, and azureblob.

How

Two tiers, as discussed in #3818:

  • download_part_size / download_concurrency — driver-local. Each driver parses the params into its Options, stores them, and uses them in DownloadAt when the per-call ReaderOptions leaves them zero. No portable-layer change.
  • allow_parallel_download — portable layer. The opt-in gate is in Bucket.Download, which doesn't consult the driver, so this adds an optional driver.ParallelDownloadDefaulter interface (DefaultAllowParallelDownload() bool) that Download queries.

Override semantics (please confirm)

Per-call ReaderOptions wins for the ints (non-zero overrides the URL default). For the bool, the per-call value is ORed with the driver default, so the URL default can only enable parallel download; a per-call AllowParallelDownload: false cannot turn off a default-enabled bucket. This sidesteps the bool unset-vs-false ambiguity. The alternative (apply the default only when opts == nil) is easy to switch to if preferred — flagging it since #3818 left it open.

Tests

  • URLOpener tests for each driver cover the new params (valid + invalid values).
  • A portable-layer test (TestDownloaderAtDefault) covers the driver default enabling parallel download with no per-call opt-in, and the no-default fallback.
  • go vet / gofmt clean; full blob, s3blob, gcsblob, and azureblob test suites pass (including the recorded conformance tests).

Docs

Each driver's package doc "URLs" section lists the three new params.

Add URL query parameters that set bucket-wide defaults for the
parallel-download options, so applications that open buckets by URL can
enable and tune parallel downloads without changing Download call sites:

  - allow_parallel_download (bool)
  - download_part_size (bytes)
  - download_concurrency (int)

The part size and concurrency are driver-local: each driver parses the
params into its Options and uses them in DownloadAt when the per-call
ReaderOptions leaves them zero. allow_parallel_download needs the
portable layer, since the opt-in gate lives in Bucket.Download, so add
an optional driver.ParallelDownloadDefaulter interface that Download
consults; the per-call ReaderOptions.AllowParallelDownload is ORed with
the driver default (the URL default can enable parallel download but a
per-call false cannot turn off a default-enabled bucket).

Implemented for s3blob, gcsblob, and azureblob, with URLOpener tests and
a portable-layer test for the defaulter.

Implements google#3818
@stanhu

stanhu commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

Closing in favor of the programmatic Bucket.SetDefaultReaderOptions approach proposed in #3818, rather than configuring this via the OpenBucket URL. Opened #NEW for that.

@stanhu

stanhu commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #3820 (Bucket.SetDefaultReaderOptions).

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.

1 participant