fix(storage): Fix retries for redirection errors.#12093
Merged
Conversation
Retrying inline might resending buffers where aren't stable yet. Surface redirects to the stream-level retry machinery to catch the resend logic.
… !s.idempotent but policy == RetryAlways
tritone
approved these changes
May 1, 2025
tritone
left a comment
Contributor
There was a problem hiding this comment.
Discussed offline with @cjc25 . Probably long term we should handle redirects separately from the main retry loop; however this can come after the refactor for pipelining. In the mean time we do need this fix to make sure redirects actually work regardless of retry strategy.
| maxPerMessageWriteSize int = int(storagepb.ServiceConstants_MAX_WRITE_CHUNK_BYTES) | ||
| ) | ||
|
|
||
| func withBidiWriteObjectRedirectionErrorRetries(s *settings) (newr *retryConfig) { |
Contributor
There was a problem hiding this comment.
Let's add a TODO to remove this after refactor?
2FaceS-bit
pushed a commit
to 2FaceS-bit/google-cloud-go
that referenced
this pull request
May 12, 2025
* fix(storage): Fix retries for redirection errors. Retrying inline might resending buffers where aren't stable yet. Surface redirects to the stream-level retry machinery to catch the resend logic. * fix check against idempotency to not lose the shouldRetry function if !s.idempotent but policy == RetryAlways --------- Co-authored-by: Chris Cotter <cjcotter@google.com>
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.
Retrying inline might fail to resend buffers which aren't stable yet. Surface redirects to the stream-level retry machinery so that stream re-init resends any buffers which might not have been persisted.