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

simulator: support change peer v2 #5609

Merged
merged 7 commits into from
Oct 27, 2022
Merged

Conversation

HunDunDM
Copy link
Member

@HunDunDM HunDunDM commented Oct 19, 2022

Signed-off-by: HunDunDM hundundm@gmail.com

What problem does this PR solve?

Issue Number: Close #5469

What is changed and how does it work?

Refactor task.go

  • Split AddVoter and PromoteLearner
  • Merge AddVoter and AddLearner
    • PendingPeer will now be added first, and will be removed after the simulated snap transfer is complete.
  • Support original ChangePeer in v2 (ChangePeerV2 and len(Changes) == 1)
    • Support DemoteVoter, and check if the Peer is not the Leader
  • Support enter joint state (ChangePeerV2 and len(Changes) > 1)
  • Support leave joint state (ChangePeerV2 and len(Changes) == 0)
  • TransferLeader adds Voter checks
  • TransferLeader supports the parsing field Peers (used to let TiKV find the optimal Peer by itself)
  • RemovePeer now always also removes the corresponding DownPeer and PendingPeer

Check List

Tests

  • Manual test (add detailed scripts or steps below)

Release note

None

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Oct 19, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • bufferflies
  • nolouch

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 submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added the release-note-none Denotes a PR that doesn't merit a release note. label Oct 19, 2022
@HunDunDM HunDunDM requested review from lhy1024 and removed request for Yisaer October 19, 2022 03:57
@codecov
Copy link

codecov bot commented Oct 19, 2022

Codecov Report

Base: 75.66% // Head: 75.77% // Increases project coverage by +0.10% 🎉

Coverage data is based on head (527b820) compared to base (d033fbf).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5609      +/-   ##
==========================================
+ Coverage   75.66%   75.77%   +0.10%     
==========================================
  Files         327      327              
  Lines       32420    32420              
==========================================
+ Hits        24531    24566      +35     
+ Misses       5770     5748      -22     
+ Partials     2119     2106      -13     
Flag Coverage Δ
unittests 75.77% <100.00%> (+0.10%) ⬆️

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

Impacted Files Coverage Δ
server/core/region_option.go 66.42% <100.00%> (ø)
pkg/metricutil/metricutil.go 82.75% <0.00%> (-10.35%) ⬇️
pkg/tempurl/tempurl.go 60.00% <0.00%> (-10.00%) ⬇️
server/schedulers/shuffle_hot_region.go 56.00% <0.00%> (-10.00%) ⬇️
...erver/config/service_middleware_persist_options.go 91.66% <0.00%> (-8.34%) ⬇️
server/storage/kv/etcd_kv.go 79.71% <0.00%> (-5.80%) ⬇️
server/tso/tso.go 70.22% <0.00%> (-3.38%) ⬇️
server/member/member.go 64.21% <0.00%> (-3.16%) ⬇️
server/cluster/unsafe_recovery_controller.go 78.27% <0.00%> (-0.69%) ⬇️
client/base_client.go 82.77% <0.00%> (-0.48%) ⬇️
... and 19 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Contributor

@lhy1024 lhy1024 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need some manual test?

desc = fmt.Sprintf("merge region %d into %d", regionID, targetRegion.GetId())
op = &mergeRegion{targetRegion: targetRegion}
case resp.GetSplitRegion() != nil:
// TODO: support split region
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when will we support it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to discuss how to perform for the three different splits.

Signed-off-by: HunDunDM <hundundm@gmail.com>
Signed-off-by: HunDunDM <hundundm@gmail.com>
Signed-off-by: HunDunDM <hundundm@gmail.com>
Signed-off-by: HunDunDM <hundundm@gmail.com>
Signed-off-by: HunDunDM <hundundm@gmail.com>
Signed-off-by: HunDunDM <hundundm@gmail.com>
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Oct 26, 2022
Copy link
Contributor

@nolouch nolouch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/merge

@ti-chi-bot
Copy link
Member

@nolouch: 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 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 Oct 27, 2022
@nolouch
Copy link
Contributor

nolouch commented Oct 27, 2022

/merge

@ti-chi-bot
Copy link
Member

@nolouch: 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: ecb7e49

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Oct 27, 2022
@ti-chi-bot ti-chi-bot merged commit 7aba282 into tikv:master Oct 27, 2022
@HunDunDM HunDunDM deleted the sim-joint branch November 7, 2022 03:13
ti-chi-bot pushed a commit that referenced this pull request Nov 15, 2022
ref #5323, ref #5468, ref #5609

Signed-off-by: HunDunDM <hundundm@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
componet/simulator release-note-none Denotes a PR that doesn't merit a release note. 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.

simulator: support joint consensus
5 participants