Skip to content

fix(buffers): publish disk buffer progress before notifying readers#25872

Open
graphcareful wants to merge 1 commit into
vectordotdev:masterfrom
graphcareful:fix/disk-v2-bounded-waits
Open

fix(buffers): publish disk buffer progress before notifying readers#25872
graphcareful wants to merge 1 commit into
vectordotdev:masterfrom
graphcareful:fix/disk-v2-bounded-waits

Conversation

@graphcareful

@graphcareful graphcareful commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Summary

Ensure disk buffer readers are notified only after flushed writer progress has been published to the shared ledger.

This consolidates record ID, buffer size, and usage accounting with reader notification for both explicit and implicit flushes. It prevents readers from consuming and acknowledging newly readable bytes while the ledger still contains stale writer state, which could corrupt accounting and stall buffer progress.

Vector configuration

No new configuration is introduced. The change applies to existing disk-buffered components, for example:

sinks:
  out:
    buffer:
      type: disk

How did you test this PR?

Using new antithesis runs located in the branch https://github.com/graphcareful/vector/tree/test/disk-buffer-oversized-progress two assertions were firing:

After discovering the root cause had nothing to do with oversized records, it was tracked down to the final batch remaining stuck in the disk buffer.

With this change the two antithesis failures no longer fire.

  • cargo test -p vector-buffers --no-default-features (77 passed, 2 pre-existing ignored)
  • cargo test -p vector-buffers publishing_writer_progress_updates_ledger_before_waking_reader --no-default-features

Change Type

  • Bug fix
  • New feature
  • Dependencies
  • Non-functional (chore, refactoring, docs)
  • Performance

Is this a breaking change?

  • Yes
  • No

Does this PR include user facing changes?

  • Yes. A changelog fragment is included.
  • No. A maintainer will apply the no-changelog label to this PR.

References

None.

@graphcareful
graphcareful requested a review from a team as a code owner July 16, 2026 16:05
@graphcareful
graphcareful requested a review from blt July 16, 2026 16:09

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bdbbd6e0f9

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread lib/vector-buffers/src/variants/disk_v2/ledger.rs Outdated
Comment thread lib/vector-buffers/src/variants/disk_v2/ledger.rs Outdated
@graphcareful
graphcareful force-pushed the fix/disk-v2-bounded-waits branch from b1cea78 to c390fab Compare July 16, 2026 20:21
@graphcareful graphcareful changed the title fix(buffers): bound disk_v2 progress waits fix(buffers): publish disk buffer progress before notifying readers Jul 16, 2026
@graphcareful
graphcareful requested review from bruceg and Copilot July 16, 2026 20:35

Copilot AI 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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@graphcareful

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: c390fab7c7

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

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