Skip to content

fix(spanner): add BatchWrite retry prerequisites, resumption state, and retry policy - #15194

Draft
alkatrivedi wants to merge 1 commit into
mainfrom
fix/spanner-batch-write-retry-1-prereqs
Draft

alkatrivedi wants to merge 1 commit into
mainfrom
fix/spanner-batch-write-retry-1-prereqs

Conversation

@alkatrivedi

Copy link
Copy Markdown

This PR introduces independent client/metrics prerequisites and the pure resumption-state and retry-policy building blocks (not yet wired into GapicSpannerRpc, so existing retry behavior is unchanged).

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request introduces robust retry and resumption logic for BatchWrite operations in the Spanner client. Key changes include the addition of BatchWriteResumptionState to track unacknowledged mutation groups and BatchWriteRetryPolicy to manage backoff and timeout budgets during stream resumptions. Additionally, BuiltInMetricsTracer was updated with thread-safe attributes, and SessionImpl was enhanced to merge default client contexts and respect transaction exclusion options. Feedback on the changes highlights a critical bug in BatchWriteResumptionState where streamIndexes is not initialized for the first attempt, potentially causing out-of-bounds exceptions, and suggests a robust simplification for extracting status codes in BatchWriteRetryPolicy using gRPC's Status.fromThrowable.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant