Skip to content

chore(spanner): use ReplicaSelector in KeyRangeCache#12749

Open
olavloite wants to merge 1 commit intomainfrom
spanner-use-replica-selector
Open

chore(spanner): use ReplicaSelector in KeyRangeCache#12749
olavloite wants to merge 1 commit intomainfrom
spanner-use-replica-selector

Conversation

@olavloite
Copy link
Copy Markdown
Contributor

Integrates the ReplicaSelector in KeyRangeCache, so it can be used to select the best replica to send the request to. This feature is effectively disabled for production, as the ReplicaSelector is set to null by default.

@olavloite olavloite requested review from a team as code owners April 10, 2026 14:57
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 implements latency-based replica selection by adding a LatencyTracker to ChannelEndpoint and updating the ReplicaSelector interface. KeyRangeCache now supports an optional ReplicaSelector for choosing between eligible tablets. Review feedback suggests optimizing ArrayList initialization in KeyRangeCache to prevent resizing and notes that the signature change in ReplicaSelector is a breaking change to the interface.

Integrates the ReplicaSelector in KeyRangeCache, so it can be used to select the
best replica to send the request to. This feature is effectively disabled for
production, as the ReplicaSelector is set to null by default.
@olavloite olavloite force-pushed the spanner-use-replica-selector branch from 1396402 to d9a46a1 Compare April 10, 2026 15:18
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