-
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
VReplication SwitchTraffic: for a dry run check if sequences need to be updated #17842
Draft
rohit-nayak-ps
wants to merge
4
commits into
vitessio:main
Choose a base branch
from
planetscale:rohit/init-sequences-dry-run
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
VReplication SwitchTraffic: for a dry run check if sequences need to be updated #17842
rohit-nayak-ps
wants to merge
4
commits into
vitessio:main
from
planetscale:rohit/init-sequences-dry-run
+1,372
−1,158
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Rohit Nayak <rohit@planetscale.com>
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
|
…value Signed-off-by: Rohit Nayak <rohit@planetscale.com>
Signed-off-by: Rohit Nayak <rohit@planetscale.com>
Signed-off-by: Rohit Nayak <rohit@planetscale.com>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #17842 +/- ##
==========================================
+ Coverage 67.45% 67.46% +0.01%
==========================================
Files 1592 1593 +1
Lines 258167 258271 +104
==========================================
+ Hits 174143 174253 +110
+ Misses 84024 84018 -6 ☔ View full report in Codecov by Sentry. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
When resharding an unsharded keyspace, sequences need to replace autoincrements. These sequences need to be set to an initial value which is above the max id. Doing this for each table is tedious and the
--initial-target-sequences
option was added toSwitchTraffic
for this purpose.However ff there are a lot of tables being resharded the process of getting the max ids from all shards and then updating the value on the unsharded keyspace can take too long. So it might still make sense for the users to update the sequence manually.
This PR adds the ability to find the sequences which need to be updated as part of switching traffic. The user can then decide on setting a value on the targets to a safe value and then not use the
--initial-target-sequences
flag.The code to get the max values was intertwined with the rest of the sequence setting code. So this PR also refactors the existing code to have a single code path for the dry run and regular path.
Related Issue(s)
fixes #17831
Checklist
Deployment Notes