VReplication: Auto renew lease on Keyspace Lock#16240
Closed
mattlord wants to merge 8 commits intovitessio:mainfrom
Closed
VReplication: Auto renew lease on Keyspace Lock#16240mattlord wants to merge 8 commits intovitessio:mainfrom
mattlord wants to merge 8 commits intovitessio:mainfrom
Conversation
Contributor
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
|
Signed-off-by: Matt Lord <mattalord@gmail.com>
09e8f62 to
0962e47
Compare
Signed-off-by: Matt Lord <mattalord@gmail.com>
mattlord
commented
Jun 20, 2024
Comment on lines
+102
to
+104
| if si.PrimaryAlias == nil { | ||
| return nil, fmt.Errorf("target shard %v has no primary tablet", shard) | ||
| } |
Member
Author
There was a problem hiding this comment.
This is unrelated, but addresses a panic raised in the Vitess Slack where the target shard had no primary tablet.
Signed-off-by: Matt Lord <mattalord@gmail.com>
Can't range over a buffered channel to drain it w/o first closing it. Just close it. Signed-off-by: Matt Lord <mattalord@gmail.com>
13bfb01 to
b1fa06d
Compare
2172180 to
5dfe973
Compare
Signed-off-by: Matt Lord <mattalord@gmail.com>
5dfe973 to
7c5c0db
Compare
Signed-off-by: Matt Lord <mattalord@gmail.com>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #16240 +/- ##
==========================================
- Coverage 68.61% 68.56% -0.06%
==========================================
Files 1544 1544
Lines 197993 198176 +183
==========================================
+ Hits 135848 135874 +26
- Misses 62145 62302 +157 ☔ View full report in Codecov by Sentry. |
73f2808 to
feca7a1
Compare
Signed-off-by: Matt Lord <mattalord@gmail.com>
feca7a1 to
9f9f13f
Compare
Member
Author
|
Replaced by: #16260 |
This file contains hidden or 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
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
VReplication uses
Keyspacetopo server locks in order to prevent concurrent changes that could cause breakages. It does that in these primary locations:SwitchTrafficandReverseTraffic) in various workflows likeMoveTablesandReshardThis is done in order to prevent concurrent changes to shared resources such as the
_vt.vreplicationrecord on target shards.At some point, I think we should add a distributed
workflowlock in the topo to coordinate on related issues. We may want those both at a keyspace level and at a shard level — depending on the level of concurrency control we require for the given operation. This lock can then also be held for as long as needed as it would not impact other Vitess operations (the Keyspace Lock is used for things e.g. like updating the throttler config, durability policy, or schema for a keyspace). This will be a major project, however, and for the time being we can instead make a relatively minor change to how theKeyspacelocks are managed in the noted cases within VReplication. In this PR the change is that we automatically renew the Keyspace Lock while holding it, up to a maximum time (hard coded at 10 mins now but will probably add a flag for this ~--max-keyspace-lock-ttl=<duration>which defaults to 10m).Related Issue(s)
Checklist