fix(storage): Set the idempotency token in the implementation of async rewrites#16114
Open
kalragauri wants to merge 1 commit into
Open
fix(storage): Set the idempotency token in the implementation of async rewrites#16114kalragauri wants to merge 1 commit into
kalragauri wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces the generation and reuse of an idempotency token during asynchronous rewrite retries in RewriterConnectionImpl. It adds an InvocationIdGenerator member, captures the generated ID in the retry loop lambda, and includes a unit test to verify that the token is reused across retries. The feedback suggests moving the generated ID into the lambda capture using std::move to avoid an unnecessary string copy.
247e403 to
9d9455f
Compare
9d9455f to
7e7fcd1
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #16114 +/- ##
==========================================
- Coverage 92.71% 92.71% -0.01%
==========================================
Files 2353 2353
Lines 218986 219029 +43
==========================================
+ Hits 203031 203066 +35
- Misses 15955 15963 +8 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
In the current implementation, during copy/move operations, if the final step commits on GCS but the client times out,
AsyncRetryLoopwill automatically retry. GCS will reject the retry as invalid since the session is closed and therewrite_tokenis already consumed.This PR includes an InvocationIdGenerator in
RewriterConnectionImplto generate the token once perIterate()step, and map it into the ClientContext for all retries of that step.