Skip to content
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

client: revise client if mismatch leader id #3432

Merged
merged 8 commits into from
Feb 23, 2021

Conversation

Yisaer
Copy link
Contributor

@Yisaer Yisaer commented Feb 22, 2021

What problem does this PR solve?

After transfer pd leader, the pd client may meet mismatch leader id several times during request global tso.

What is changed and how it works?

This request make mismatch error appearing at most once after transferring pd leader.

Check List

Tests

  • Unit test

Release note

  • No release note

Signed-off-by: Song Gao <[email protected]>
Signed-off-by: Song Gao <[email protected]>
@ti-chi-bot ti-chi-bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 22, 2021
@Yisaer Yisaer marked this pull request as ready for review February 22, 2021 12:48
@ti-chi-bot ti-chi-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 22, 2021
@codecov
Copy link

codecov bot commented Feb 22, 2021

Codecov Report

Merging #3432 (451e4cb) into master (d28e248) will decrease coverage by 0.07%.
The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3432      +/-   ##
==========================================
- Coverage   75.16%   75.08%   -0.08%     
==========================================
  Files         244      244              
  Lines       23509    23523      +14     
==========================================
- Hits        17670    17662       -8     
- Misses       4274     4290      +16     
- Partials     1565     1571       +6     
Flag Coverage Δ
unittests 75.08% <66.66%> (-0.08%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
client/client.go 64.56% <65.00%> (-0.38%) ⬇️
server/grpc_service.go 58.43% <100.00%> (+1.16%) ⬆️
pkg/etcdutil/etcdutil.go 84.70% <0.00%> (-3.53%) ⬇️
server/schedulers/random_merge.go 60.00% <0.00%> (-3.34%) ⬇️
server/tso/allocator_manager.go 76.46% <0.00%> (-3.01%) ⬇️
server/schedule/operator/step.go 67.44% <0.00%> (-1.67%) ⬇️
pkg/btree/btree.go 85.30% <0.00%> (-0.97%) ⬇️
server/handler.go 41.97% <0.00%> (-0.50%) ⬇️
server/server.go 72.44% <0.00%> (-0.31%) ⬇️
server/tso/global_allocator.go 78.03% <0.00%> (ø)
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d28e248...cd43f95. Read the comment docs.

client/client.go Outdated Show resolved Hide resolved
tests/server/tso/global_tso_test.go Outdated Show resolved Hide resolved
tests/server/tso/global_tso_test.go Outdated Show resolved Hide resolved
client/client.go Outdated Show resolved Hide resolved
Signed-off-by: Song Gao <[email protected]>
Signed-off-by: Song Gao <[email protected]>
Signed-off-by: Song Gao <[email protected]>
Signed-off-by: Song Gao <[email protected]>
Signed-off-by: Song Gao <[email protected]>
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Feb 23, 2021
pkg/errs/errs.go Outdated Show resolved Hide resolved
Signed-off-by: Song Gao <[email protected]>
@ti-chi-bot
Copy link
Member

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • JmPotato
  • rleungx

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by writing /lgtm in a comment.
Reviewer can cancel approval by writing /lgtm cancel in a comment.

@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Feb 23, 2021
@Yisaer
Copy link
Contributor Author

Yisaer commented Feb 23, 2021

/merge

@ti-chi-bot
Copy link
Member

@Yisaer: It seems you want to merge this PR, I will help you trigger all the tests:

/run-all-tests

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 ti-community-infra/tichi repository.

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: cd43f95

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Feb 23, 2021
@ti-chi-bot ti-chi-bot merged commit ba729c9 into tikv:master Feb 23, 2021
@Yisaer Yisaer added component/client Client logic. component/tso Timestamp Oracle. labels Feb 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/client Client logic. component/tso Timestamp Oracle. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants