Skip to content

schedule: fix location label in placement rule not work well with rule checker#6633

Merged
ti-chi-bot[bot] merged 7 commits intotikv:masterfrom
rleungx:location-label
Jun 20, 2023
Merged

schedule: fix location label in placement rule not work well with rule checker#6633
ti-chi-bot[bot] merged 7 commits intotikv:masterfrom
rleungx:location-label

Conversation

@rleungx
Copy link
Member

@rleungx rleungx commented Jun 19, 2023

What problem does this PR solve?

Issue Number: Close #6637

What is changed and how does it work?

This PR is going to use the region store as the source instead of rule stores.

Check List

Tests

  • Unit test

Release note

None.

@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Jun 19, 2023

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • CabinfeverB
  • 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.

Details

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 bot added do-not-merge/needs-linked-issue release-note-none Denotes a PR that doesn't merit a release note. labels Jun 19, 2023
@ti-chi-bot ti-chi-bot bot requested review from HunDunDM and lhy1024 June 19, 2023 10:44
@ti-chi-bot ti-chi-bot bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jun 19, 2023
if oldStore == 0 {
return nil, nil
}
ruleStores := c.getRuleFitStores(rf)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think here the rule store is a sub-set of theregion stores? maybe directly get all stores which match the rule constraint.

@codecov
Copy link

codecov bot commented Jun 19, 2023

Codecov Report

Patch coverage: 63.63% and project coverage change: -0.08 ⚠️

Comparison is base (4bb5c23) 74.61% compared to head (050a1c5) 74.53%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6633      +/-   ##
==========================================
- Coverage   74.61%   74.53%   -0.08%     
==========================================
  Files         417      417              
  Lines       43060    43067       +7     
==========================================
- Hits        32129    32101      -28     
- Misses       8087     8112      +25     
- Partials     2844     2854      +10     
Flag Coverage Δ
unittests 74.53% <63.63%> (-0.08%) ⬇️

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

Impacted Files Coverage Δ
pkg/schedule/checker/replica_strategy.go 79.62% <0.00%> (-6.38%) ⬇️
pkg/schedule/checker/rule_checker.go 83.62% <100.00%> (+0.17%) ⬆️

... and 29 files with indirect coverage changes

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

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.

rest lgtm

@CabinfeverB
Copy link
Member

/check-issue-triage-complete

@rleungx rleungx requested review from CabinfeverB and nolouch June 20, 2023 05:10
@ti-chi-bot ti-chi-bot bot added the status/LGT1 Indicates that a PR has LGTM 1. label Jun 20, 2023
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.

lgtm

@ti-chi-bot ti-chi-bot bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Jun 20, 2023
}
}

newStore, filterByTempState := strategy.SelectStoreToImprove(coLocationStores, oldStore)
Copy link
Contributor

Choose a reason for hiding this comment

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

what's happen if coLocationStores is nil.

Copy link
Member Author

@rleungx rleungx Jun 20, 2023

Choose a reason for hiding this comment

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

add a check in both SelectStoreToImprove and SelectStoreToFix

rleungx added 3 commits June 20, 2023 15:08
Signed-off-by: Ryan Leung <rleungx@gmail.com>
Signed-off-by: Ryan Leung <rleungx@gmail.com>
Signed-off-by: Ryan Leung <rleungx@gmail.com>
rleungx added 2 commits June 20, 2023 15:08
Signed-off-by: Ryan Leung <rleungx@gmail.com>
Signed-off-by: Ryan Leung <rleungx@gmail.com>
Signed-off-by: Ryan Leung <rleungx@gmail.com>
@rleungx
Copy link
Member Author

rleungx commented Jun 20, 2023

/merge

@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Jun 20, 2023

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

/run-all-tests

You only need to trigger /merge once, and if the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

If you have any questions about the PR merge process, please refer to pr process.

Details

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
Contributor

ti-chi-bot bot commented Jun 20, 2023

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

DetailsCommit hash: 36b0138

@ti-chi-bot ti-chi-bot bot added the status/can-merge Indicates a PR has been approved by a committer. label Jun 20, 2023
@rleungx rleungx added needs-cherry-pick-release-7.2 needs-cherry-pick-release-6.5 Should cherry pick this PR to release-6.5 branch. labels Jun 20, 2023
@rleungx
Copy link
Member Author

rleungx commented Jun 20, 2023

/test build

@ti-chi-bot ti-chi-bot bot merged commit 77083e6 into tikv:master Jun 20, 2023
@rleungx rleungx deleted the location-label branch June 20, 2023 08:37
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-6.5: #6641.

@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-7.1: #6642.

@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-7.2: #6643.

rleungx added a commit to rleungx/pd that referenced this pull request Jun 20, 2023
…e checker (tikv#6633)

close tikv#6637

Signed-off-by: Ryan Leung <rleungx@gmail.com>
rleungx added a commit to rleungx/pd that referenced this pull request Jun 20, 2023
…e checker (tikv#6633)

close tikv#6637

Signed-off-by: Ryan Leung <rleungx@gmail.com>
rleungx added a commit that referenced this pull request Jun 20, 2023
#6648)

* schedule: fix location label in placement rule not work well with rule checker (#6633)

close #6637

Signed-off-by: Ryan Leung <rleungx@gmail.com>
rleungx added a commit to rleungx/pd that referenced this pull request Jun 21, 2023
…e checker (tikv#6633)

close tikv#6637

Signed-off-by: Ryan Leung <rleungx@gmail.com>
rleungx added a commit to rleungx/pd that referenced this pull request Dec 4, 2023
…e checker (tikv#6633)

close tikv#6637

Signed-off-by: Ryan Leung <rleungx@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-cherry-pick-release-6.5 Should cherry pick this PR to release-6.5 branch. needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. needs-cherry-pick-release-7.2 release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. 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.

Placement rule in SQL isn't compatible with rule checker when using location labels

5 participants