Skip to content
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

rework tabletbalancer interface to avoid unnecessary sort #443

Open
wants to merge 4 commits into
base: slack-vitess-r14.0.5
Choose a base branch
from

Conversation

demmer
Copy link
Collaborator

@demmer demmer commented Jul 8, 2024

Description

Rework the tabletbalancer interface to avoid an unnecessary sort.

There's actually no need in the tabletgateway to ever sort the full list of potential tablet candidates, because each query attempt only goes to a single tablet, and then if that fails, the withRetry loop records which tablet failed and then re-enters the loop to try again.

Therefore, refactor the balancer to replace ShuffleTablets with a simple Pick interface that just returns the best tablet to route to.

Related Issue(s)

Checklist

  • "Backport to:" labels have been added if this change should be back-ported
  • Tests were added or are not required
  • Did the new or modified tests pass consistently locally and on the CI
  • Documentation was added or is not required

Deployment Notes

@demmer demmer requested a review from a team as a code owner July 8, 2024 19:06
@demmer demmer force-pushed the tabletbalancer-pick-one branch 2 times, most recently from 6021332 to 577377d Compare July 8, 2024 19:15
There's actually no need in the tabletgateway to ever sort the full list of
potential tablet candidates, because each query attempt only goes to a single
tablet, and then if that fails, the withRetry loop records which tablet failed
and then re-enters the loop to try again.

Therefore, refactor the balancer to replace ShuffleTablets with a simple Pick
interface that just returns the best tablet to route to.
Copy link

github-actions bot commented Aug 8, 2024

This PR is being marked as stale because it has been open for 30 days with no activity. To rectify, you may do any of the following:

  • Push additional commits to the associated branch.
  • Remove the stale label.
  • Add a comment indicating why it is not stale.

If no action is taken within 7 days, this PR will be closed.

@github-actions github-actions bot added the Stale label Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants