Repository navigation
fix(storage): preserve appended data when retrying a stream - #18563
Open
Shubham-Padkonde wants to merge 1 commit into
Open
Shubham-Padkonde wants to merge 1 commit into
Shubham-Padkonde wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces support for buffer-relative offsets during the resume and recovery of append operations in the asynchronous appendable object writer. It tracks the buffer_start_offset in the write state, validates that the recovery offset falls within the current append buffer, and updates the user buffer seek position relative to this start offset. Corresponding unit tests have been added to verify correct recovery behavior and error handling for unrecoverable offsets. I have no feedback to provide as there are no review comments.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #18475.
After the first append,
persisted_sizeis an absolute object offset but the retry buffer contains only the current call's data. Seeking that absolute offset can move beyond the buffer and let the append return without resending its unpersisted bytes.Record the buffer's starting object offset and use relative positions in both failure recovery and stream reopening. A stale progress response can precede the current append, so reopening still obtains the authoritative position before any bytes are resent. If that position lies outside the available buffer, raise
ValueErrorinstead of silently completing an unrecoverable upload.Regression coverage exercises partial and complete persistence, stale progress, and offsets outside the available data. Nine cases fail on the original implementation.
Validation: all 2,031 Storage unit tests pass on Linux/Python 3.12, including all 240 async tests. The changed files pass Ruff import/format checks and Flake8. The Windows run had six unrelated encoding/path test failures; all async tests passed there. Coverage of the new branches is exercised, but the pre-existing writer module does not have 100% overall coverage. No live GCS system tests were run.