Skip to content

feat(storage): implement replay buffer for appendable upload - #6605

Merged
vsharonlynn merged 4 commits into
googleapis:mainfrom
vsharonlynn:replay-foundation
Sep 18, 2026
Merged

vsharonlynn merged 4 commits into
googleapis:mainfrom
vsharonlynn:replay-foundation

Conversation

@vsharonlynn

@vsharonlynn vsharonlynn commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Issue #5716 .

@product-auto-label product-auto-label Bot added the api: storage Issues related to the Cloud Storage API. label Sep 1, 2026

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request introduces a new ReplayBuffer module to manage unacknowledged data chunks, trim acknowledged data, and support resending chunks upon stream reconnection. The reviewer suggested refactoring the acknowledge method to separate the loop logic and adding a safety comment explaining the invariants when slicing the chunk data.

Comment thread src/storage/src/storage/bidi_write/replay_buffer.rs Outdated
@codecov

codecov Bot commented Sep 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.67442% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 97.17%. Comparing base (5064632) to head (2814ea2).

Files with missing lines Patch % Lines
...rc/storage/src/storage/bidi_write/replay_buffer.rs 97.67% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6605      +/-   ##
==========================================
- Coverage   97.17%   97.17%   -0.01%     
==========================================
  Files         328      329       +1     
  Lines      109802   109974     +172     
==========================================
+ Hits       106702   106867     +165     
- Misses       3100     3107       +7     

☔ 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.

Comment thread src/storage/src/storage/bidi_write/replay_buffer.rs Outdated
Comment thread src/storage/src/storage/bidi_write/replay_buffer.rs Outdated
Comment thread src/storage/src/storage/bidi_write/replay_buffer.rs Outdated
Comment thread src/storage/src/storage/bidi_write/replay_buffer.rs Outdated
@vsharonlynn vsharonlynn changed the title feat(storage): implement 32 MiB replay buffer for appendable upload feat(storage): implement replay buffer for appendable upload Sep 8, 2026

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

I would say it's in general a ready to merge state except 2 nits.

Comment thread src/storage/src/storage/bidi_write/replay_buffer.rs Outdated
Comment thread src/storage/src/storage/bidi_write/replay_buffer.rs
- Drop the unreachable expect() by reading the front chunk length before
  popping it, removing the redundant panic branch.
- Relabel the // SAFETY: comment as // Invariant:, since Bytes::slice is
  safe Rust and the comment documents an algorithmic invariant, not an
  unsafe contract.
@vsharonlynn
vsharonlynn dismissed joshuatants’s stale review September 18, 2026 06:30

Olivia has approved. Thanks!

@vsharonlynn
vsharonlynn merged commit 47154ab into googleapis:main Sep 18, 2026
42 checks passed
@vsharonlynn
vsharonlynn deleted the replay-foundation branch September 18, 2026 06:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: storage Issues related to the Cloud Storage API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants