-
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: Properly Handle FK Constraints When Deferring Secondary Keys #14543
Merged
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: Matt Lord <[email protected]>
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
|
vitess-bot
bot
added
NeedsDescriptionUpdate
The description is not clear or comprehensive enough, and needs work
NeedsIssue
A linked issue is missing for this Pull Request
NeedsWebsiteDocsUpdate
What it says
labels
Nov 17, 2023
mattlord
added
Type: Bug
Component: VReplication
and removed
NeedsWebsiteDocsUpdate
What it says
labels
Nov 17, 2023
mattlord
force-pushed
the
defer_secondary_keys_fks
branch
2 times, most recently
from
November 17, 2023 15:59
a8d1ec4
to
c1c2cf0
Compare
Signed-off-by: Matt Lord <[email protected]>
mattlord
force-pushed
the
defer_secondary_keys_fks
branch
from
November 17, 2023 16:05
c1c2cf0
to
3fcdb55
Compare
Signed-off-by: Matt Lord <[email protected]>
mattlord
added
Backport to: release-18.0
and removed
NeedsDescriptionUpdate
The description is not clear or comprehensive enough, and needs work
NeedsIssue
A linked issue is missing for this Pull Request
labels
Nov 19, 2023
deepthi
approved these changes
Nov 30, 2023
Should this really be back ported to v18? I thought we were not back porting anything FK-related because it is experimental. |
I thought it was worth doing, but we don't have to. |
rohit-nayak-ps
approved these changes
Dec 3, 2023
ejortegau
pushed a commit
to slackhq/vitess
that referenced
this pull request
Dec 13, 2023
… Keys (vitessio#14543) Signed-off-by: Matt Lord <[email protected]>
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
The
MoveTables
andReshard
commands/workflows support deferring secondary key generation until after the copy phase completes — adding all of them in one shot per table — via the--defer-secondary-keys
flag.In v18 we began adding full support for foreign keys and in the process of doing that work we realized that when deferring secondary keys the workflow would fail with an error that a secondary key could not be dropped because it was needed for a foreign key. For example, the new unit test cases fail this way on main:
Even if this did work, we should not remove those keys so that we can utilize the foreign keys as expected during the workflow's copy phase in the future.
In this PR we add a check to see if the secondary key is required for a foreign key constraint and if so we do not temporarily remove it during the copy phase.
Related Issue(s)
Checklist