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

schedulers: opt balance witness when store nr larger than peer nr #6149

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

ethercflow
Copy link
Member

@ethercflow ethercflow commented Mar 12, 2023

ref #5762

What problem does this PR solve?

Issue Number: ref #5762

What is changed and how does it work?

  1. When stores nr larger than peers nr, move witness instead of transfer witenss
  2. For the same region, when witness switching occurs, the order of step generation is guaranteed: demote witness(peer1) to witness learner, non-witness learner, voter, voter (peer2) -> witness, to avoid there is a non-witness learner applying snapshot and a witness at the same time
  3. When verifying the legitimacy of the targetLeader in the builder, the judgment is made based on the result of the transfer witness instead of the intermediate state
  4. Add metrics in pd.json
  5. Consider witness when statistic regions info
schedulers: opt balance witness when store nr larger than peer nr

Check List

Tests

  • Unit test
  • Integration test
  • Manual test
    • Test with sysbench prepare

Code changes

  • None

Side effects

  • None

Related changes

  • None

Release note

None.

@ti-chi-bot
Copy link
Member

[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 /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 Mar 12, 2023
@ti-chi-bot ti-chi-bot requested review from rleungx and Yisaer March 12, 2023 04:01
@codecov
Copy link

codecov bot commented Mar 12, 2023

Codecov Report

Patch coverage: 81.86% and project coverage change: -0.02 ⚠️

Comparison is base (0b36238) 74.41% compared to head (f3b533c) 74.40%.

❗ Current head f3b533c differs from pull request most recent head c4afec6. Consider uploading reports for the commit c4afec6 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6149      +/-   ##
==========================================
- Coverage   74.41%   74.40%   -0.02%     
==========================================
  Files         391      392       +1     
  Lines       38175    38316     +141     
==========================================
+ Hits        28409    28510     +101     
- Misses       7241     7283      +42     
+ Partials     2525     2523       -2     
Flag Coverage Δ
unittests 74.40% <81.86%> (-0.02%) ⬇️

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

Impacted Files Coverage Δ
server/cluster/cluster.go 82.23% <0.00%> (+0.09%) ⬆️
pkg/schedule/operator/step.go 77.10% <61.11%> (-0.16%) ⬇️
pkg/schedule/schedulers/balance_witness.go 65.89% <69.01%> (-1.17%) ⬇️
pkg/schedule/operator/create_operator.go 90.96% <75.00%> (-0.81%) ⬇️
pkg/schedule/operator/builder.go 86.34% <94.44%> (-0.26%) ⬇️
pkg/core/basic_cluster.go 94.33% <100.00%> (+0.58%) ⬆️
pkg/core/region.go 88.97% <100.00%> (ø)
pkg/core/region_tree.go 95.65% <100.00%> (+0.08%) ⬆️
pkg/schedule/schedulers/utils.go 89.93% <100.00%> (+0.25%) ⬆️

... and 37 files with indirect coverage changes

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 in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@@ -91,6 +91,27 @@ func (bc *BasicCluster) GetNonWitnessVoterStores(region *RegionInfo) []*StoreInf
return Stores
}

// GetOptionalStoresForRegion returns all Stores that can be used to store the region's peer.
func (bc *BasicCluster) GetOptionalStoresForRegion(region *RegionInfo) []*StoreInfo {
Copy link
Contributor

Choose a reason for hiding this comment

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

how about add new filter for this store? like excludedFilter.

@ethercflow ethercflow force-pushed the opt-balance-witness branch from 751843e to 0c4a8c8 Compare March 14, 2023 09:55
@ti-chi-bot ti-chi-bot bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 22, 2023
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented May 22, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. release-note-none Denotes a PR that doesn't merit a release note.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants