Skip to content

force blob (write) sync every 10k appends#169

Merged
benfleis merged 1 commit into
duckdb:v1.5-variegatafrom
benfleis:force-periodic-blob-write-syncs
May 12, 2026
Merged

force blob (write) sync every 10k appends#169
benfleis merged 1 commit into
duckdb:v1.5-variegatafrom
benfleis:force-periodic-blob-write-syncs

Conversation

@benfleis

@benfleis benfleis commented May 12, 2026

Copy link
Copy Markdown
Member

This addresses duckdb/duckdb-delta#299, which reports users hitting Azure's 100k outstanding staged block limit and failing.

  • Main change: triggers Commit of staged blocks when max is reached
  • generalizes AzureReadOptions -> AzureOptions in order to
  • add AzureOptions.write_staged_blocks_max (default=10k)
  • simplifies block mgmt to counts (instead of vectors)
  • update read block size to 8MiB (from 1MiB - matches rclone obj store defaults which are well tested)

It introduces a new option:

azure_write_staged_blocks_max -- Maximum number of staged
(uncommitted) blocks before an automatic mid-write commit.
Azure limits blobs to 100,000 total blocks; this safety valve
prevents hitting that limit by committing staged blocks early.
Default: 10000.

This addresses duckdb/duckdb-delta#299, which reports users hitting
Azure's 100k outstanding staged block limit and failing.

This PR:

- main: triggers Commit of staged blocks when `max` is reached
- generalizes AzureReadOptions -> AzureOptions in order to
- add AzureOptions.write_staged_blocks_max (default=10k)
- also, simplifies block mgmt to counts (instead of vectors)

It introduces a new option:

> `azure_write_staged_blocks_max` -- Maximum number of staged
> (uncommitted) blocks before an automatic mid-write commit.
> Azure limits blobs to 100,000 total blocks; this safety valve
> prevents hitting that limit by committing staged blocks early.
> Default: 10000.
@benfleis

Copy link
Copy Markdown
Member Author

@samansmink samansmink left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, added small comment

idx_t buffer_size = 1 * 1024 * 1024;
struct AzureOptions {
int32_t read_transfer_concurrency = 5;
int64_t read_transfer_chunk_size = (int64_t)8 * 1024 * 1024;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Was the chunk size change deliberate? If so it probably should go into the PR description

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Ah yes, I sliced apart the original PR into pre- and post- v1.5.3 parts but missed that one. I'll add comment since it's a good adjustment in any case.

@benfleis
benfleis merged commit 4072700 into duckdb:v1.5-variegata May 12, 2026
18 checks passed
@djouallah

Copy link
Copy Markdown
Contributor

@benfleis can you please update it to core_nightly or core, current ly it is still at 2ad247d

@benfleis

Copy link
Copy Markdown
Member Author

Hi @djouallah this alone doesn't fully address the problem, it exposes a different limit in Azure. I'm awaiting the review/landing of #168. After that lands it will be in nightly builds to confirm.

@benfleis benfleis mentioned this pull request May 29, 2026
benfleis added a commit that referenced this pull request Jul 13, 2026
**Forward fill v1.5 variegata PRs -> main**
Forward-ports:

- #169 — force blob (write) sync every 10k appends (Azure 100k staged
  block limit)
- #168 — buffer/stage/commit rewrite: fixed-size local write buffer
  (mirrors S3), configurable buffer size, fixes DFS sync-offset
- #173 — actionlint CI fixes (ccache key, setup-python@v5)

Not forward-ported (branch-specific to v1.5-variegata, don't apply to
main): #166 (duckdb pin bump to variegata tag), #167 (CI refs
pinned to v1.5-variegata / v1.5.3). #162 already on main via
separate cherry-picks.

**CI/Build**
- Needed action version updates + Actionlint fixes
- Windows build/image vcvars fix
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.

3 participants