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

rules: optimize the implementation of FitRegion #4012

Merged
merged 2 commits into from
Sep 13, 2021

Conversation

HunDunDM
Copy link
Member

@HunDunDM HunDunDM commented Aug 19, 2021

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

What problem does this PR solve?

// FitRegion tries to fit the region with placement rules.
func (c *RaftCluster) FitRegion(region *core.RegionInfo) *placement.RegionFit {
	return c.GetRuleManager().FitRegion(c, region)
}

Due to the above code, CacheCluster in #4003 has no real effect. It is called RaftCluster.GetStores, not CacheCluster.GetStores.

What is changed and how it works?

Implementation of abstract FitRegion.

Check List

Tests

  • Unit test

Code changes

Side effects

Related changes

  • Need to cherry-pick to the release branch

Release note

None

Signed-off-by: HunDunDM <hundundm@gmail.com>
@ti-chi-bot
Copy link
Member

ti-chi-bot commented Aug 19, 2021

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • bufferflies
  • disksing

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 Aug 19, 2021
@ti-chi-bot ti-chi-bot requested a review from Yisaer August 19, 2021 12:01
@codecov
Copy link

codecov bot commented Aug 19, 2021

Codecov Report

Merging #4012 (97fe20a) into master (08f92d6) will increase coverage by 0.07%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4012      +/-   ##
==========================================
+ Coverage   74.46%   74.54%   +0.07%     
==========================================
  Files         258      258              
  Lines       26323    26322       -1     
==========================================
+ Hits        19601    19621      +20     
+ Misses       4975     4962      -13     
+ Partials     1747     1739       -8     
Flag Coverage Δ
unittests 74.54% <100.00%> (+0.07%) ⬆️

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

Impacted Files Coverage Δ
pkg/mock/mockcluster/mockcluster.go 95.22% <ø> (-0.02%) ⬇️
server/cluster/cluster.go 83.03% <ø> (+0.80%) ⬆️
server/schedule/checker/priority_checker.go 78.94% <100.00%> (ø)
server/schedule/checker/rule_checker.go 82.88% <100.00%> (ø)
server/schedule/filter/filters.go 90.69% <100.00%> (ø)
server/schedule/operator/builder.go 88.39% <100.00%> (ø)
server/schedule/opt/healthy.go 100.00% <100.00%> (ø)
server/schedule/opt/opts.go 100.00% <100.00%> (ø)
server/schedulers/shuffle_hot_region.go 55.55% <0.00%> (-10.11%) ⬇️
server/member/member.go 63.10% <0.00%> (-3.21%) ⬇️
... and 15 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 08f92d6...97fe20a. Read the comment docs.

@disksing disksing self-requested a review August 31, 2021 11:39
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Aug 31, 2021
Copy link
Contributor

@bufferflies bufferflies left a comment

Choose a reason for hiding this comment

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

lgtm

@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 Sep 9, 2021
@nolouch
Copy link
Contributor

nolouch commented Sep 13, 2021

/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: cbe775b

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Sep 13, 2021
@ti-chi-bot ti-chi-bot merged commit 740fac1 into tikv:master Sep 13, 2021
@HunDunDM HunDunDM deleted the fitregion-getstore branch September 13, 2021 07:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

5 participants