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

schedule: fix panic when switching placement rules (#7415) #7422

Merged

Conversation

ti-chi-bot
Copy link
Member

This is an automated cherry-pick of #7415

What problem does this PR solve?

Issue Number: Close #7414.

What is changed and how does it work?

When we going to disable the placement rule, we might first check:

if c.conf.IsPlacementRulesEnabled() {

Before we change it, the value is true. But when we call:

fit := c.priorityInspector.Inspect(region)

func (p *PriorityInspector) Inspect(region *core.RegionInfo) (fit *placement.RegionFit) {
var makeupCount int
if p.conf.IsPlacementRulesEnabled() {
makeupCount, fit = p.inspectRegionInPlacementRule(region)
} else {
makeupCount = p.inspectRegionInReplica(region)
}
priority := 0 - makeupCount
p.addOrRemoveRegion(priority, region.GetID())
return
}

The value can be changed to false. So the fit will be nil in this case.

Check List

Tests

  • Unit test

Release note

None.

@ti-chi-bot ti-chi-bot added the release-note-none Denotes a PR that doesn't merit a release note. label Nov 23, 2023
@ti-chi-bot ti-chi-bot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. type/cherry-pick-for-release-6.1 This PR is cherry-picked to release-6.1 from a source PR. labels Nov 23, 2023
Copy link
Contributor

ti-chi-bot bot commented Nov 23, 2023

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • lhy1024

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.

Copy link
Contributor

ti-chi-bot bot commented Nov 23, 2023

This cherry pick PR is for a release branch and has not yet been approved by triage owners.
Adding the do-not-merge/cherry-pick-not-approved label.

To merge this cherry pick:

  1. It must be approved by the approvers firstly.
  2. AFTER it has been approved by approvers, please wait for the cherry-pick merging approval from triage owners.

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.

@ti-chi-bot ti-chi-bot bot requested review from disksing and rleungx November 23, 2023 09:39
@ti-chi-bot ti-chi-bot bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Nov 23, 2023
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.

need fix conflict

Signed-off-by: Ryan Leung <[email protected]>
@ti-chi-bot ti-chi-bot bot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Feb 9, 2024
Copy link

codecov bot commented Feb 9, 2024

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Project coverage is 75.52%. Comparing base (b092996) to head (9f10745).
Report is 6 commits behind head on release-6.1.

Files with missing lines Patch % Lines
server/schedule/checker/rule_checker.go 0.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@               Coverage Diff               @@
##           release-6.1    #7422      +/-   ##
===============================================
+ Coverage        75.39%   75.52%   +0.12%     
===============================================
  Files              308      308              
  Lines            30591    30593       +2     
===============================================
+ Hits             23063    23104      +41     
+ Misses            5516     5484      -32     
+ Partials          2012     2005       -7     
Flag Coverage Δ
unittests 75.52% <0.00%> (+0.12%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ti-chi-bot ti-chi-bot bot added the status/LGT1 Indicates that a PR has LGTM 1. label Feb 19, 2024
@ti-chi-bot ti-chi-bot added the cherry-pick-approved Cherry pick PR approved by release team. label Jul 26, 2024
@rleungx rleungx requested review from JmPotato and removed request for disksing and rleungx July 26, 2024 04:07
@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Sep 10, 2024
@ti-chi-bot ti-chi-bot bot added the lgtm label Sep 10, 2024
Copy link
Contributor

ti-chi-bot bot commented Sep 10, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lhy1024, rleungx

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

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot removed the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Sep 10, 2024
Copy link
Contributor

ti-chi-bot bot commented Sep 10, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-09-10 07:21:31.748737497 +0000 UTC m=+340961.489161421: ☑️ agreed by rleungx.
  • 2024-09-10 07:22:28.28341019 +0000 UTC m=+341018.023834129: ☑️ agreed by lhy1024.

@ti-chi-bot ti-chi-bot bot added the dco-signoff: yes Indicates the PR's author has signed the dco. label Sep 10, 2024
Copy link
Contributor

ti-chi-bot bot commented Sep 10, 2024

@ti-chi-bot: Your PR was out of date, I have automatically updated it for you.

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.

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 bot merged commit e878b62 into tikv:release-6.1 Sep 10, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved cherry-pick-approved Cherry pick PR approved by release team. dco-signoff: yes Indicates the PR's author has signed the dco. lgtm release-note-none Denotes a PR that doesn't merit a release note. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. status/LGT1 Indicates that a PR has LGTM 1. type/cherry-pick-for-release-6.1 This PR is cherry-picked to release-6.1 from a source PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants