chore(spanner): attach Request ID headers to Spanner RPCs - #6248
chore(spanner): attach Request ID headers to Spanner RPCs#6248olavloite wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Code Review
This pull request implements automatic generation and propagation of Spanner request IDs across unary and streaming RPCs, including proper handling of retries and aborted transactions. The review feedback suggests optimizing the retry logic in ResultSet by using std::mem::take to avoid an unnecessary clone of GaxRequestOptions when updating the request ID header.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6248 +/- ##
==========================================
+ Coverage 96.07% 96.08% +0.01%
==========================================
Files 273 273
Lines 68742 69267 +525
==========================================
+ Hits 66042 66557 +515
- Misses 2700 2710 +10 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
4f67749 to
3e957d6
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request implements request ID propagation and tracking for Spanner RPCs (both unary and streaming), ensuring that retries are correctly tracked by incrementing the attempt suffix in the x-goog-spanner-request-id header. It introduces a SpannerRequestIdInterceptor to handle the headers, updates ResultSet to manually increment the attempt suffix on streaming retries, and adds comprehensive tests. The review feedback points out that applying #[allow(dead_code)] to the entire impl RequestIdCreator block silences compiler warnings for active production code, and suggests moving test-only methods to a separate block or marking them individually.
3e957d6 to
74f39a9
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request implements Spanner request ID generation and propagation across unary, streaming, and retried RPCs. It introduces a SpannerRequestIdInterceptor to append attempt numbers to the x-goog-spanner-request-id header, and updates ResultSet to manually increment the attempt suffix during streaming retries. A review comment identifies a potential integer overflow panic and incorrect channel ID mapping when using channel_hint + 1 directly, suggesting a safer modulo-based channel ID calculation instead.
Automatically attach unique `x-goog-spanner-request-id` headers to Spanner queries and reads, tracking attempt numbers across unary and streaming RPC retries.
74f39a9 to
ad968fd
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request implements robust propagation and retry handling for the x-goog-spanner-request-id header across unary and streaming Spanner RPCs. It introduces request ID generation, integrates it with various client operations, and updates the attempt interceptor and result set retry logic to correctly track and increment attempt numbers. Feedback is provided to optimize the stream retry logic in result_set.rs by avoiding unnecessary cloning of the HeaderMap unless a modification is actually required.
Automatically attach unique
x-goog-spanner-request-idheaders to Spanner queries and reads, tracking attempt numbers across unary and streaming RPC retries.