-
Notifications
You must be signed in to change notification settings - Fork 51
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
Prefer read replicas when choosing nodes to search #1768
Prefer read replicas when choosing nodes to search #1768
Conversation
This pull request has been linked to Shortcut Story #8610: [Replication] Use secondaries first. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1768 +/- ##
==========================================
- Coverage 82.19% 82.17% -0.03%
==========================================
Files 336 336
Lines 19852 19829 -23
==========================================
- Hits 16317 16294 -23
Misses 3535 3535
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
Looks great! Just left one comment!
Would be nice to catch errors when querying a secondary and fallback to a primary. But maybe in a separate PR
eb0b38e
to
e721c2e
Compare
Description
Change logic around
choose_node
so read replicas are preferred over primary index nodesPotential improvements
With this logic, if we call
choose_node(shard, read_only=True)
and there's 1 read replica and 2 primary nodes, searches will always go to the secondary. Maybe a better load balancing can be thought.How was this PR tested?
Unit tests