-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
rewrite shuffleTablets to be clearer and more efficient #15716
Conversation
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
Tests
Documentation
New flags
If a workflow is added or modified:
Backward compatibility
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #15716 +/- ##
==========================================
+ Coverage 68.40% 68.43% +0.03%
==========================================
Files 1556 1558 +2
Lines 195121 195957 +836
==========================================
+ Hits 133479 134111 +632
- Misses 61642 61846 +204 ☔ View full report in Codecov by Sentry. |
@demmer you need to signoff the commit and force-push. |
Oh right. My Vitess contribution skills are rusty! |
Implement a simple single-pass scan through the list of tablets that both randomly shuffles the set and pulls the same-cell hosts to the front of the list. Signed-off-by: Michael Demmer <mdemmer@slack-corp.com>
32ad8ca
to
9f1e23a
Compare
@deepthi Pushed again with the Signed-Off. |
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.
Good to see you back :)
if sameCell < diffCell { | ||
// fast forward the `sameCell` lookup to `diffCell + 1`, `diffCell` unchanged | ||
sameCell = diffCell + 1 | ||
// Randomly shuffle the list of tablets, putting the same-cell hosts at the front |
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.
nit: I'd always use tablet/tablets instead of host/hosts. Those are the Vitess terms.
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.
ok. edited.
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.
Love it!
Let's give @demmer a chance to address feedback and then we can merge. |
@demmer DCO failed again. I guess the latest commit hasn't been signed off properly. |
Signed-off-by: Michael Demmer <mdemmer@slack-corp.com>
0bed5c6
to
d43907a
Compare
Oops sorry -- pushed a rework
…On Thu, Apr 25, 2024 at 9:40 AM Deepthi Sigireddi ***@***.***> wrote:
@demmer <https://github.com/demmer> DCO failed again. I guess the latest
commit hasn't been signed off properly.
—
Reply to this email directly, view it on GitHub
<#15716 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAZHXWE723GKA5D7NT3DK53Y7EWYJAVCNFSM6AAAAABGHRVMU2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANZXG4ZDAMJTHA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Description
Implement a simple single-pass scan through the list of tablets that both randomly shuffles the set and pulls the same-cell hosts to the front of the list.
This is the same functionality as the old code, just with a simpler algorithm that only needs to loop once through the set of tablets so it's a marginally more efficient approach.
Related Issue(s)
Checklist
Deployment Notes