Skip to content

fix(storage): Fix retries for redirection errors.#12093

Merged
tritone merged 4 commits into
googleapis:mainfrom
cjc25:retry-redirect-fix
May 1, 2025
Merged

fix(storage): Fix retries for redirection errors.#12093
tritone merged 4 commits into
googleapis:mainfrom
cjc25:retry-redirect-fix

Conversation

@cjc25

@cjc25 cjc25 commented May 1, 2025

Copy link
Copy Markdown
Contributor

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.

Retrying inline might resending buffers where aren't stable yet. Surface
redirects to the stream-level retry machinery to catch the resend logic.
@cjc25 cjc25 requested review from a team May 1, 2025 03:55
@product-auto-label product-auto-label Bot added the api: storage Issues related to the Cloud Storage API. label May 1, 2025

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

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.

Comment thread storage/grpc_writer.go
maxPerMessageWriteSize int = int(storagepb.ServiceConstants_MAX_WRITE_CHUNK_BYTES)
)

func withBidiWriteObjectRedirectionErrorRetries(s *settings) (newr *retryConfig) {

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.

Let's add a TODO to remove this after refactor?

@tritone tritone merged commit 3e177e7 into googleapis:main May 1, 2025
8 checks passed
@cjc25 cjc25 deleted the retry-redirect-fix branch May 1, 2025 20:15
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>
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.

2 participants