Skip to content

chore(spanner): wire routing feedback and cooldown tracking for unary RPCs - #6749

Open
olavloite wants to merge 1 commit into
googleapis:mainfrom
olavloite:spanner-location-aware-routing-cooldown-tracking-unary
Open

chore(spanner): wire routing feedback and cooldown tracking for unary RPCs#6749
olavloite wants to merge 1 commit into
googleapis:mainfrom
olavloite:spanner-location-aware-routing-cooldown-tracking-unary

Conversation

@olavloite

Copy link
Copy Markdown
Contributor

Connect live RPC feedback into LocationRouter and LatencyRegistry for all unary database RPCs in Spanner Omni location-aware routing:

  • Record latency and repair cooldown failure tiers on successful direct RPCs.
  • Trigger endpoint cooldown with server-recommended retry delays and record latency error penalties on ResourceExhausted and Unavailable failures.
  • Guard against placing default gateway fallback connections on cooldown.
  • Add RequestRoutingGroupUid trait to associate hint-bearing requests with their covering Paxos group UID, cleanly handling unkeyed requests.
  • Recursively extract gRPC status codes and retry delays across GAX Status, nested Error::exhausted instances, HTTP headers, and TonicStatus.

… RPCs

Connect live RPC feedback into LocationRouter and LatencyRegistry for all
unary database RPCs in Spanner Omni location-aware routing:
- Record latency and repair cooldown failure tiers on successful direct RPCs.
- Trigger endpoint cooldown with server-recommended retry delays and record
  latency error penalties on ResourceExhausted and Unavailable failures.
- Guard against placing default gateway fallback connections on cooldown.
- Add RequestRoutingGroupUid trait to associate hint-bearing requests with
  their covering Paxos group UID, cleanly handling unkeyed requests.
- Recursively extract gRPC status codes and retry delays across GAX Status,
  nested Error::exhausted instances, HTTP headers, and TonicStatus.
@olavloite
olavloite requested review from a team as code owners September 9, 2026 06:42
@product-auto-label product-auto-label Bot added the api: spanner Issues related to the Spanner API. label Sep 9, 2026

@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 implements RPC execution feedback recording for Spanner request routing. It introduces the record_routing_feedback mechanism to update the LocationRouter and LatencyRegistry with latency and cooldown information based on RPC success or failure (specifically handling ResourceExhausted and Unavailable errors). It also adds a RequestRoutingGroupUid trait to extract routing group UIDs from various request types, enhances error parsing in retry_delay.rs to extract status codes and retry delays from nested errors, and includes comprehensive unit and integration mock tests to verify the feedback, cooldown, and fallback behaviors. As there are no review comments, I have no further feedback to provide.

@codecov

codecov Bot commented Sep 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.93048% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.95%. Comparing base (9d8ef68) to head (8aedada).
⚠️ Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
src/spanner/src/database_client.rs 97.84% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6749      +/-   ##
==========================================
+ Coverage   96.94%   96.95%   +0.01%     
==========================================
  Files         315      315              
  Lines      105078   105261     +183     
==========================================
+ Hits       101864   102057     +193     
+ Misses       3214     3204      -10     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Labels

api: spanner Issues related to the Spanner API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant