-
Notifications
You must be signed in to change notification settings - Fork 725
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 75.61% 75.63% +0.02%
==========================================
Files 460 461 +1
Lines 72135 72381 +246
==========================================
+ Hits 54543 54745 +202
- Misses 14104 14129 +25
- Partials 3488 3507 +19
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!
056d12a
to
7f23d25
Compare
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. |
7f23d25
to
9a75c5e
Compare
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
cddbb93
to
c8a6dd3
Compare
c8a6dd3
to
de79e49
Compare
d2519ae
to
40913a5
Compare
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]>
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]>
40913a5
to
c314f61
Compare
What problem does this PR solve?
Issue Number: ref #8477.
What is changed and how does it work?
This PR tries to avoid there are two allocators at the same time. If the TSO service has an allocator that might finish the sync timestamp. Then PD still allocates TSO, after enabling the dynamic switch, it might have a TSO fallback issue.
TSO service sync t1, PD is allocating from t2, t2 is less than t1 at the moment. But if PD syncs again and starts from t2 which is larger than t1, meanwhile TSO is not discovered immediately. The TSO might fall back.
Check List
Tests
Release note