-
Notifications
You must be signed in to change notification settings - Fork 721
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
mcs: register tso allocator #7891
base: master
Are you sure you want to change the base?
Conversation
[REVIEW NOTIFICATION] This pull request has not been approved. To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
5a3803a
to
acf9c7d
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #7891 +/- ##
==========================================
+ Coverage 77.36% 77.39% +0.02%
==========================================
Files 468 468
Lines 60943 61035 +92
==========================================
+ Hits 47146 47235 +89
+ Misses 10252 10245 -7
- Partials 3545 3555 +10
Flags with carried forward coverage won't be shown. Click here to find out more. |
pkg/tso/global_allocator.go
Outdated
func (gta *GlobalTSOAllocator) txnWithTTL(key, value string) (clientv3.LeaseID, error) { | ||
ctx, cancel := context.WithTimeout(gta.ctx, etcdutil.DefaultRequestTimeout) | ||
defer cancel() | ||
grantResp, err := gta.am.etcdClient.Grant(ctx, 3) |
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.
What about setting a const for 3
?
|
||
func (gta *GlobalTSOAllocator) register() (<-chan *clientv3.LeaseKeepAliveResponse, bool) { | ||
ctx, cancel := context.WithTimeout(gta.ctx, time.Duration(3)*time.Second) | ||
resp, err := gta.am.etcdClient.Get(ctx, gta.am.allocatorKeyPrefix, clientv3.WithPrefix()) |
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 allocatorKeyPrefix
varies in different modes, and it cannot retrieve keys from other allocators as expected.
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.
nice catch!
Signed-off-by: Ryan Leung <[email protected]>
Signed-off-by: Ryan Leung <[email protected]>
Signed-off-by: Ryan Leung <[email protected]>
Signed-off-by: Ryan Leung <[email protected]>
Signed-off-by: Ryan Leung <[email protected]>
Signed-off-by: Ryan Leung <[email protected]>
056d12a
to
7f23d25
Compare
[FORMAT CHECKER NOTIFICATION] Notice: To remove the 📖 For more info, you can check the "Linking issues" section in the CONTRIBUTING.md. |
PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
What problem does this PR solve?
Issue Number: Close #xxx
What is changed and how does it work?
Check List
Tests
Code changes
Side effects
Related changes
pingcap/docs
/pingcap/docs-cn
:pingcap/tiup
:Release note