Repository navigation
fix(storage): send routing token once and use redirect write handle on append reconnect - #19205
Open
Yonghui-Lee wants to merge 1 commit into
Open
Yonghui-Lee wants to merge 1 commit into
Yonghui-Lee wants to merge 1 commit into
Conversation
…n append reconnect
Contributor
|
Warning Gemini encountered an error creating the review. You can try again by commenting |
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.
When
AsyncAppendableObjectWriter.append()gets aBidiWriteObjectRedirectedError, it reconnects with the wrong request. This was found in review of #19092 (thanks @zhixiangli).Problem
x-goog-request-params: routing_token=...to the metadata and then callsopen(), which adds the same header again. The stream joins allx-goog-request-paramsvalues, so the reopen carriesrouting_tokentwice. GCS rejects it with400 InvalidArgument(GRPC_INVALID_X_GOOG_REQUEST_PARAMS_DUPLICATE_ENTRY), and the append fails after a redirect.write_handlefrom the redirect is saved in the retry state but never copied toself.write_handle, so the reopen uses the old handle.Changes
open()already adds it fromself._routing_token.write_state.write_handlefrom the redirect toself.write_handlebefore reopening.append()and checks that the reopen uses the redirect's write handle and token, sends the routing token header once, and keeps caller metadata.Testing
tests/unit/asyncio/retry/test_writes_resumption_strategy.pyandtests/unit/asyncio/test_async_appendable_object_writer.pypass. The new test fails without the fix.mainthe reopen fails with the duplicate entry error and only 2 MiB is stored. With this change the append completes and the object checksum matches.Note:
maincurrently has the storage rollback from #19186. This change is small and may need a rebase when those commits are restored.