-
Notifications
You must be signed in to change notification settings - Fork 1.5k
feat(bigtable): Enable routing cookie for enhanced retries #12964
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
bigtable/bigtable.go
Outdated
|
|
||
| // For routing cookie | ||
| cookiePrefix = "x-goog-cbt-cookie-" | ||
| attemptHeader = "x-goog-cbt-attempt" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry that the design doc was unclear about this, the attempt part is not implemented on the GFE and we may not need it, so we can remove this header.
however, we do keep stats on the number of attempt of a request (regardless of routing cookie) and the header for that is bigtable-attempt. But this is a separate feature and we can do that in a different PR in the future.
| // Operation has started but not the attempt. | ||
| // So, create only operation tracer and not attempt tracer | ||
| currOpTracer := opTracer{} | ||
| currOpTracer := opTracer{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think metrics is the right place for this feature (like I mentioned in the other comment) because this is retry related and doesn't really have anything to do with metrics?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not want to add another tracer.
I can create a follow up PR to this one. Renaming metricsTracer to Tracer and file to tracer.go
PR created by the Librarian CLI to initialize a release. Merging this PR will auto trigger a release. Librarian Version: v0.7.0 Language Image: us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-prod/librarian-go@sha256:718167d5c23ed389b41f617b3a00ac839bdd938a6bd2d48ae0c2f1fa51ab1c3d <details><summary>bigtable: 1.41.0</summary> ## [1.41.0](bigtable/v1.40.1...bigtable/v1.41.0) (2025-12-15) ### Features * add PeerInfo proto in Bigtable API (PiperOrigin-RevId: 829585900) ([185951b](185951b3)) * precompute featureflags in client and reuse (#13297) ([3b3253a](3b3253ac)) * Add experimental Bigtable connection pool with custom load balancing strategy. (#12882) ([7aa9612](7aa96127)) * Enable ALTS hard bound token in Bigtable w/ direct access (#13153) ([9023934](90239341)) * Enable routing cookie and attempt headers for enhanced retries (#12964) ([96cfd47](96cfd47a)) ### Bug Fixes * fix project id sent in otel (#13286) ([4865868](4865868c)) * screaming uppercase metric status (#13484) ([b35ee8f](b35ee8fd)) ### Performance Improvements * parallelize the exportTimeSeries function (#13004) ([bafd691](bafd691d)) </details>
Implements client-side logic to support the Cloud Bigtable routing cookie protocol (see go/cbt-support-routing-cookie). This feature enhances server-initiated retries and improves resilience.
Specific modifications:
RoutingCookie: truein thebigtable-featuresheader.x-goog-cbt-cookie-received in response metadata are collected and sent back on subsequent requests for the same operation.opTracerinmetrics.gonow stores the current cookies and theroutingAttemptnumber.These changes enable more sophisticated load balancing and retry strategies, by giving the service and routing layers visibility into the client's retry state and a mechanism to influence client behavior.
Conformance tests from https://github.com/googleapis/cloud-bigtable-clients-test/tree/v0.0.3 now pass:
Fixes: #12658