Skip to content

fix(disk buffer): retry reads for published writer progress - #25941

Open
jjh5887 wants to merge 1 commit into
vectordotdev:masterfrom
jjh5887:fix/disk-v2-reader-progress-wait
Open

fix(disk buffer): retry reads for published writer progress#25941
jjh5887 wants to merge 1 commit into
vectordotdev:masterfrom
jjh5887:fix/disk-v2-reader-progress-wait

Conversation

@jjh5887

@jjh5887 jjh5887 commented Jul 23, 2026

Copy link
Copy Markdown

Summary

Fix a rare disk_v2 reader stall by checking published writer progress before waiting for another writer notification.

If the reader reaches EOF on the current writer file but the ledger shows that the writer has already published unread records, the reader now briefly backs off and retries the read instead of waiting indefinitely for another notification. Writer-progress waits are also bounded so periodic re-checks remain a fallback safety net.

Vector configuration

N/A. This changes internal disk_v2 buffer reader behavior.

The production shape that motivated this is a low-volume source using a disk buffer, where the writer remains open and a single record may arrive after a long idle period.

How did you test this PR?

  • Added reader_receives_record_after_cold_start_write, which starts the reader on an empty disk buffer, keeps the writer open, idles briefly, then writes and flushes one record.
  • Ran cargo fmt --package vector-buffers.
  • Ran cargo test -p vector-buffers variants::disk_v2::tests::cold_start::reader_receives_record_after_cold_start_write --no-default-features.
  • Ran cargo test -p vector-buffers --no-default-features -- --test-threads=1.
  • Ran cargo clippy -p vector-buffers --tests --no-default-features -- -D warnings.
  • Ran make check-fmt.
  • Ran make check-markdown.
  • Ran cargo vdev check changelog-fragments --merge-base upstream/master.
  • Ran make check-clippy.

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. Please add a changelog fragment based on our guidelines.
  • No. A maintainer will apply the no-changelog label to this PR.

References

@jjh5887
jjh5887 requested a review from a team as a code owner July 23, 2026 22:40
@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@datadog-vectordotdev

This comment has been minimized.

@jjh5887
jjh5887 force-pushed the fix/disk-v2-reader-progress-wait branch from 7c222b8 to 83532a1 Compare July 23, 2026 22:48
@jjh5887

jjh5887 commented Jul 23, 2026

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

@pront pront 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.

Hi @jjh5887, thank you for this fix!

We recently merged a lot of buffers fixes. I suspect this bug was fixed already. You can test with the latest nightly to confirm. Thanks!

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