Skip to content

fix(spanner): always prefer leader for strong reads and retries should only check EWMA score#12879

Open
rahul2393 wants to merge 1 commit intomainfrom
prefer-leader-routing
Open

fix(spanner): always prefer leader for strong reads and retries should only check EWMA score#12879
rahul2393 wants to merge 1 commit intomainfrom
prefer-leader-routing

Conversation

@rahul2393
Copy link
Copy Markdown
Contributor

No description provided.

@rahul2393 rahul2393 requested review from a team as code owners April 21, 2026 18:48
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

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 refactors the tablet selection logic in KeyRangeCache.java to ensure that the leader is prioritized during initial requests when preferLeader is set, while falling back to score-aware selection for retries or when the leader is excluded. Feedback indicates that the call to selectScoreAwareTablet should explicitly disable leader bias during retries to strictly follow performance-based selection. New test cases were added to validate these scenarios.

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