-
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
Topology Server Locking Refactor #16005
Conversation
Signed-off-by: Manan Gupta <[email protected]>
Signed-off-by: Manan Gupta <[email protected]>
Signed-off-by: Manan Gupta <[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
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #16005 +/- ##
==========================================
- Coverage 68.24% 68.23% -0.01%
==========================================
Files 1562 1542 -20
Lines 197171 196969 -202
==========================================
- Hits 134550 134394 -156
+ Misses 62621 62575 -46 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Manan Gupta <[email protected]>
…re tests Signed-off-by: Manan Gupta <[email protected]>
Signed-off-by: Manan Gupta <[email protected]>
… more tests Signed-off-by: Manan Gupta <[email protected]>
Signed-off-by: Manan Gupta <[email protected]>
Signed-off-by: Manan Gupta <[email protected]>
Signed-off-by: Manan Gupta <[email protected]>
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.
This looks great! Thank you @GuptaManan100 ! ❤️ I only had one comment that I think is worth discussing before approval. What you have now is equivalent to what we already have, so we could leave it as-is and change later, but it's a relatively easy change and I think it's worth doing now if we can. Let me know what you think.
One other general question.. I thought that we were going to effectively make CheckKeyspaceLockedAndRenew
be CheckKeyspaceLocked
. I think we did that here, but it wasn't clear from the diff so wanted to double check.
Thanks again!
Signed-off-by: Manan Gupta <[email protected]>
I should have called out the changes in The problem with the earlier implementation was that it was wrong. After looking at the code, I realised that whether the lock is renewed or not when we call |
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.
The only open issue is the lock path issue but I will defer to @rohit-nayak-ps on that (he has the larger refactor in mind better than I do). I'm fine keeping it as-is. I don't think there would be major upgrade issues there if we did later change it, since keyspace routing rules are experimental and we haven't added locking for the other types yet. Thanks again! Nice work on this @GuptaManan100
Thank you @mattlord! Now that release-20 has been cut, are we good to be able to merge this? |
IMO at least, yes. 🙂 |
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.
❤️
Description
This PR refactors the resource locking in the topology server.
Vitess has had the ability to lock shards and keyspaces for a long time. We recently added the code to also lock routing rules in #15807 and noticed that the code for locking the three resources was essentially the same with minor differences.
It is a good idea to refactor all of this code such that the locking and unlocking code is common for all three resources. This PR accomplishes this goal. Since locking of shards and keyspace is very crucial to the correct functionality of Vitess, we have added tests for all the three supported topo servers in addition to the unit tests to ensure that the functionality of locking is unchanged by the refactor.
This refactor also allows addition of new resources to be locked quite easily, since only an interface implementation of
iTopoLock
is required.Related Issue(s)
Checklist
Deployment Notes