Skip to content

affinity: use isRegionPlacementRuleSatisfiedWithBestLocation instead of IsRegionReplicated (#10192)#10741

Merged
ti-chi-bot[bot] merged 3 commits into
tikv:release-8.5from
ti-chi-bot:cherry-pick-10192-to-release-8.5
Jun 4, 2026
Merged

affinity: use isRegionPlacementRuleSatisfiedWithBestLocation instead of IsRegionReplicated (#10192)#10741
ti-chi-bot[bot] merged 3 commits into
tikv:release-8.5from
ti-chi-bot:cherry-pick-10192-to-release-8.5

Conversation

@ti-chi-bot
Copy link
Copy Markdown
Member

This is an automated cherry-pick of #10192

What problem does this PR solve?

Issue Number: Ref #10149

What is changed and how does it work?

check location labels in AffinityChecker

Check List

Tests

  • Unit test

Related changes

  • Need to cherry-pick to the release branch

Release note

None.

Summary by CodeRabbit

  • New Features

    • Affinity checks now evaluate placement-rule satisfaction (including a cached and cacheless region fit path) and region label isolation reports a numeric level for level-based checks.
  • Bug Fixes

    • Better detection and handling of superior replica placements, stricter enforcement of isolation constraints, preservation of learners, and early exit when placement rules are disabled.
  • Metrics

    • Added a counter for placement-rules-disabled occurrences.
  • Tests

    • Expanded and updated tests for placement-rule, isolation-level, normalization, and placement interactions.

@ti-chi-bot ti-chi-bot added dco-signoff: yes Indicates the PR's author has signed the dco. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. release-note-none Denotes a PR that doesn't merit a release note. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. type/cherry-pick-for-release-8.5 This PR is cherry-picked to release-8.5 from a source PR. labels May 29, 2026
@ti-chi-bot
Copy link
Copy Markdown
Member Author

@HunDunDM This PR has conflicts, I have hold it.
Please resolve them or ask others to resolve them, then comment /unhold to remove the hold label.

@ti-chi-bot
Copy link
Copy Markdown
Contributor

ti-chi-bot Bot commented May 29, 2026

@ti-chi-bot: ## If you want to know how to resolve it, please read the guide in TiDB Dev Guide.

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.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 29, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f806cdf7-2375-49b7-bc98-f5fd0d08dcc0

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ti-chi-bot ti-chi-bot Bot added cherry-pick-approved Cherry pick PR approved by release team. and removed do-not-merge/cherry-pick-not-approved labels May 29, 2026
@lhy1024
Copy link
Copy Markdown
Member

lhy1024 commented Jun 3, 2026

@HunDunDM please fix conflict

HunDunDM added 2 commits June 4, 2026 01:19
Signed-off-by: HunDunDM <hundundm@gmail.com>
Signed-off-by: HunDunDM <hundundm@gmail.com>
@HunDunDM
Copy link
Copy Markdown
Member

HunDunDM commented Jun 3, 2026

We also need to cherry-pick #9439 and #9512 .

…of IsRegionReplicated (tikv#10192)

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

HunDunDM commented Jun 3, 2026

/cherry-pick-invite

@ti-chi-bot
Copy link
Copy Markdown
Member Author

@HunDunDM Please accept the invitation then you can push to the cherry-pick pull requests.
Comment with "/cherry-pick-invite" if the invitation is expired.
https://github.com/ti-chi-bot/pd/invitations

@HunDunDM HunDunDM force-pushed the cherry-pick-10192-to-release-8.5 branch from 32d0274 to 0d6ceb4 Compare June 3, 2026 18:09
@ti-chi-bot ti-chi-bot Bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jun 3, 2026
@HunDunDM
Copy link
Copy Markdown
Member

HunDunDM commented Jun 3, 2026

/unhold

@ti-chi-bot ti-chi-bot Bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 3, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 4, 2026

Codecov Report

❌ Patch coverage is 90.78014% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.08%. Comparing base (d76bec1) to head (0d6ceb4).
⚠️ Report is 16 commits behind head on release-8.5.

Additional details and impacted files
@@               Coverage Diff               @@
##           release-8.5   #10741      +/-   ##
===============================================
+ Coverage        77.93%   78.08%   +0.15%     
===============================================
  Files              484      488       +4     
  Lines            65594    66959    +1365     
===============================================
+ Hits             51119    52288    +1169     
- Misses           10703    10827     +124     
- Partials          3772     3844      +72     
Flag Coverage Δ
unittests 78.08% <90.78%> (+0.15%) ⬆️

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ti-chi-bot ti-chi-bot Bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Jun 4, 2026
@lhy1024
Copy link
Copy Markdown
Member

lhy1024 commented Jun 4, 2026

@rleungx PTAL

@ti-chi-bot ti-chi-bot Bot added the lgtm label Jun 4, 2026
@ti-chi-bot
Copy link
Copy Markdown
Contributor

ti-chi-bot Bot commented Jun 4, 2026

[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

Details 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 Jun 4, 2026
@ti-chi-bot
Copy link
Copy Markdown
Contributor

ti-chi-bot Bot commented Jun 4, 2026

[LGTM Timeline notifier]

Timeline:

  • 2026-06-04 03:36:38.787210355 +0000 UTC m=+412699.857527745: ☑️ agreed by lhy1024.
  • 2026-06-04 10:24:18.641670273 +0000 UTC m=+437159.711987673: ☑️ agreed by rleungx.

@ti-chi-bot ti-chi-bot Bot merged commit 11f331a into tikv:release-8.5 Jun 4, 2026
114 of 123 checks passed
@ti-chi-bot ti-chi-bot Bot deleted the cherry-pick-10192-to-release-8.5 branch June 4, 2026 10:32
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/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. type/cherry-pick-for-release-8.5 This PR is cherry-picked to release-8.5 from a source PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants