Skip to content

Conversation

@lhy1024
Copy link
Contributor

@lhy1024 lhy1024 commented Dec 2, 2025

What problem does this PR solve?

Issue Number: Close #xxx

What is changed and how does it work?

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Code changes

Side effects

  • Possible performance regression
  • Increased code complexity
  • Breaking backward compatibility

Related changes

Release note

None.

HunDunDM and others added 30 commits November 12, 2025 13:23
* affinity define

Signed-off-by: HunDunDM <[email protected]>

* affinity define

Signed-off-by: HunDunDM <[email protected]>

---------

Signed-off-by: HunDunDM <[email protected]>
* schedule: support api and storage for affinity

Signed-off-by: lhy1024 <[email protected]>

* remove IsAffinitySchedulingEnabled control

Signed-off-by: lhy1024 <[email protected]>

* address comments

Signed-off-by: lhy1024 <[email protected]>

---------

Signed-off-by: lhy1024 <[email protected]>
* add max-affinity-merge-region-size config

Signed-off-by: HunDunDM <[email protected]>

* add manager and checker to cluster

Signed-off-by: HunDunDM <[email protected]>

---------

Signed-off-by: HunDunDM <[email protected]>
* add store healthy check

Signed-off-by: lhy1024 <[email protected]>

* use RunBatchOpInTxn

Signed-off-by: lhy1024 <[email protected]>

* call label

Signed-off-by: lhy1024 <[email protected]>

* add operator and test

Signed-off-by: lhy1024 <[email protected]>

* fix DeleteAffinityGroup

Signed-off-by: lhy1024 <[email protected]>

---------

Signed-off-by: lhy1024 <[email protected]>
Signed-off-by: lhy1024 <[email protected]>
Co-authored-by: HunDunDM <[email protected]>
* rename

Signed-off-by: lhy1024 <[email protected]>

* use a combo operator

Signed-off-by: lhy1024 <[email protected]>

---------

Signed-off-by: lhy1024 <[email protected]>
Co-authored-by: HunDunDM <[email protected]>
* invalid region cache && checker frame

Signed-off-by: HunDunDM <[email protected]>

* update and get groupInfo

Signed-off-by: HunDunDM <[email protected]>

* tiny fix

Signed-off-by: HunDunDM <[email protected]>

* tiny fix

Signed-off-by: HunDunDM <[email protected]>

* check region healthy and replicated

Signed-off-by: HunDunDM <[email protected]>

* tiny fix

Signed-off-by: HunDunDM <[email protected]>

* tiny fix

Signed-off-by: HunDunDM <[email protected]>

---------

Signed-off-by: HunDunDM <[email protected]>
* check Stores availability

Signed-off-by: HunDunDM <[email protected]>

* tiny fix

Signed-off-by: HunDunDM <[email protected]>

---------

Signed-off-by: HunDunDM <[email protected]>
…r && RangeCount (#19)

* add initialized check and GetAllAffinityGroupStates

Signed-off-by: HunDunDM <[email protected]>

* add region affinity filter

Signed-off-by: HunDunDM <[email protected]>

* count region label ranges

Signed-off-by: HunDunDM <[email protected]>

* tiny fix

Signed-off-by: HunDunDM <[email protected]>

---------

Signed-off-by: HunDunDM <[email protected]>
* add more api

Signed-off-by: lhy1024 <[email protected]>

* fix type and force

Signed-off-by: lhy1024 <[email protected]>

* reduce code

Signed-off-by: lhy1024 <[email protected]>

* add TODO

Signed-off-by: lhy1024 <[email protected]>

* fix lint and optimize applyRemoveOps

Signed-off-by: lhy1024 <[email protected]>

* address comments

Signed-off-by: lhy1024 <[email protected]>

---------

Signed-off-by: lhy1024 <[email protected]>
* rename labels to LabelRule

Signed-off-by: HunDunDM <[email protected]>

* rename GroupInfo to runtimeGroupInfo

Signed-off-by: HunDunDM <[email protected]>

* refactor affinity.go

Signed-off-by: HunDunDM <[email protected]>

* unified RangeModification and keyRange

Signed-off-by: HunDunDM <[email protected]>

---------

Signed-off-by: HunDunDM <[email protected]>
Signed-off-by: HunDunDM <[email protected]>
* add http client

Signed-off-by: lhy1024 <[email protected]>

* fix lint

Signed-off-by: lhy1024 <[email protected]>

* remove DataLayout

Signed-off-by: lhy1024 <[email protected]>

---------

Signed-off-by: lhy1024 <[email protected]>
* add enable config

Signed-off-by: lhy1024 <[email protected]>

* support evict leader

Signed-off-by: lhy1024 <[email protected]>

---------

Signed-off-by: lhy1024 <[email protected]>
* support pd-ctl

Signed-off-by: lhy1024 <[email protected]>

* fix lint

Signed-off-by: lhy1024 <[email protected]>

* use tidb http

Signed-off-by: lhy1024 <[email protected]>

---------

Signed-off-by: lhy1024 <[email protected]>
Signed-off-by: lhy1024 <[email protected]>
* unify keyRange and GroupRangeModification

Signed-off-by: HunDunDM <[email protected]>

* remove initialized

Signed-off-by: HunDunDM <[email protected]>

* add syncer

Signed-off-by: HunDunDM <[email protected]>

* add plan

Signed-off-by: HunDunDM <[email protected]>

* add txn func

Signed-off-by: HunDunDM <[email protected]>

* tiny fix

Signed-off-by: HunDunDM <[email protected]>

* tiny fix

Signed-off-by: HunDunDM <[email protected]>

* tiny fix

Signed-off-by: HunDunDM <[email protected]>

* tiny fix

Signed-off-by: HunDunDM <[email protected]>

* tiny fix

Signed-off-by: HunDunDM <[email protected]>

* address comment

Signed-off-by: HunDunDM <[email protected]>

---------

Signed-off-by: HunDunDM <[email protected]>
* new state

Signed-off-by: HunDunDM <[email protected]>

* add group state

Signed-off-by: HunDunDM <[email protected]>

* fix store state

Signed-off-by: HunDunDM <[email protected]>

* add todo

Signed-off-by: HunDunDM <[email protected]>

* address comment

Signed-off-by: HunDunDM <[email protected]>

* tiny fix

Signed-off-by: HunDunDM <[email protected]>

* tiny fix

Signed-off-by: HunDunDM <[email protected]>

* address comment

Signed-off-by: HunDunDM <[email protected]>

---------

Signed-off-by: HunDunDM <[email protected]>
* fix todo and test

Signed-off-by: lhy1024 <[email protected]>

* fix empty range

Signed-off-by: lhy1024 <[email protected]>

---------

Signed-off-by: lhy1024 <[email protected]>
* fix isAffinity

Signed-off-by: HunDunDM <[email protected]>

* fix isAffinity

Signed-off-by: HunDunDM <[email protected]>

---------

Signed-off-by: HunDunDM <[email protected]>
* fix checker test

Signed-off-by: lhy1024 <[email protected]>

* add more tests

Signed-off-by: lhy1024 <[email protected]>

* fix counter

Signed-off-by: lhy1024 <[email protected]>

* add more tests

Signed-off-by: lhy1024 <[email protected]>

---------

Signed-off-by: lhy1024 <[email protected]>
* expire group in checker

Signed-off-by: HunDunDM <[email protected]>

* tiny fix

Signed-off-by: HunDunDM <[email protected]>

---------

Signed-off-by: HunDunDM <[email protected]>
* fix handler tests and more tests

Signed-off-by: lhy1024 <[email protected]>

* add some tests

Signed-off-by: lhy1024 <[email protected]>

* refactor test

Signed-off-by: lhy1024 <[email protected]>

* make test stable

Signed-off-by: lhy1024 <[email protected]>

* fix lint

Signed-off-by: lhy1024 <[email protected]>

* refactor

Signed-off-by: lhy1024 <[email protected]>

* fix

Signed-off-by: lhy1024 <[email protected]>

* address comment

Signed-off-by: lhy1024 <[email protected]>

* fix nolint

Signed-off-by: lhy1024 <[email protected]>

---------

Signed-off-by: lhy1024 <[email protected]>
* fix replicated check

Signed-off-by: HunDunDM <[email protected]>

* tiny fix

Signed-off-by: HunDunDM <[email protected]>

---------

Signed-off-by: HunDunDM <[email protected]>
* fix manager test

Signed-off-by: lhy1024 <[email protected]>

* add more tests

Signed-off-by: lhy1024 <[email protected]>

* add some comments in handler

Signed-off-by: lhy1024 <[email protected]>

---------

Signed-off-by: lhy1024 <[email protected]>
Signed-off-by: lhy1024 <[email protected]>
* rm todo

Signed-off-by: lhy1024 <[email protected]>

* mv log

Signed-off-by: lhy1024 <[email protected]>

* add manager metrics

Signed-off-by: lhy1024 <[email protected]>

* rename

Signed-off-by: lhy1024 <[email protected]>

---------

Signed-off-by: lhy1024 <[email protected]>
@codecov
Copy link

codecov bot commented Dec 2, 2025

Codecov Report

❌ Patch coverage is 66.07989% with 501 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.32%. Comparing base (3c3a471) to head (e66bf69).
⚠️ Report is 1 commits behind head on master.

❌ Your patch check has failed because the patch coverage (66.07%) is below the target coverage (74.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9985      +/-   ##
==========================================
- Coverage   78.34%   78.32%   -0.02%     
==========================================
  Files         511      520       +9     
  Lines       68319    69676    +1357     
==========================================
+ Hits        53523    54573    +1050     
- Misses      10921    11154     +233     
- Partials     3875     3949      +74     
Flag Coverage Δ
unittests 78.32% <66.07%> (-0.02%) ⬇️

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.

@lhy1024 lhy1024 force-pushed the affinity-test branch 2 times, most recently from d0c0509 to 24a9b82 Compare December 2, 2025 15:27
lhy1024 and others added 6 commits December 3, 2025 00:11
* fix some tests

Signed-off-by: lhy1024 <[email protected]>

* make test stable

Signed-off-by: lhy1024 <[email protected]>

---------

Signed-off-by: lhy1024 <[email protected]>
* refactor group state

Signed-off-by: HunDunDM <[email protected]>

* tiny fix

Signed-off-by: HunDunDM <[email protected]>

* tiny fix

Signed-off-by: HunDunDM <[email protected]>

---------

Signed-off-by: HunDunDM <[email protected]>
* change config

Signed-off-by: lhy1024 <[email protected]>

* fix some tests

Signed-off-by: lhy1024 <[email protected]>

* add some tests

Signed-off-by: lhy1024 <[email protected]>

* fix client test

Signed-off-by: lhy1024 <[email protected]>

---------

Signed-off-by: lhy1024 <[email protected]>
* add test and rename

Signed-off-by: lhy1024 <[email protected]>

* address comments

Signed-off-by: lhy1024 <[email protected]>

* add more comments

Signed-off-by: lhy1024 <[email protected]>

* fix lint

Signed-off-by: lhy1024 <[email protected]>

---------

Signed-off-by: lhy1024 <[email protected]>
Signed-off-by: lhy1024 <[email protected]>
* refactor condition

Signed-off-by: HunDunDM <[email protected]>

* tiny fix

Signed-off-by: HunDunDM <[email protected]>

* tiny fix

Signed-off-by: HunDunDM <[email protected]>

* address comment

Signed-off-by: HunDunDM <[email protected]>

---------

Signed-off-by: HunDunDM <[email protected]>
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Dec 5, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign yisaer for approval. For more information see the Code Review Process.
Please ensure that each of them provides their approval before proceeding.

The full list of commands accepted by this bot can be found 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

lhy1024 and others added 4 commits December 9, 2025 11:54
* address comments in txn

Signed-off-by: lhy1024 <[email protected]>

* add store ID

Signed-off-by: lhy1024 <[email protected]>

* fix

Signed-off-by: lhy1024 <[email protected]>

---------

Signed-off-by: lhy1024 <[email protected]>
* fix validateNoKeyRangeOverlapLocked

Signed-off-by: lhy1024 <[email protected]>

* fix others

Signed-off-by: lhy1024 <[email protected]>

* fix

Signed-off-by: lhy1024 <[email protected]>

---------

Signed-off-by: lhy1024 <[email protected]>
HunDunDM and others added 10 commits December 10, 2025 00:04
* remove redundant tests and add some new tests

Signed-off-by: lhy1024 <[email protected]>

* fix lint

Signed-off-by: lhy1024 <[email protected]>

---------

Signed-off-by: lhy1024 <[email protected]>
* handle the ordering of watch events

Signed-off-by: HunDunDM <[email protected]>

* tiny fix

Signed-off-by: HunDunDM <[email protected]>

* tiny fix

Signed-off-by: HunDunDM <[email protected]>

---------

Signed-off-by: HunDunDM <[email protected]>
* replace with failpoint

Signed-off-by: lhy1024 <[email protected]>

* refactor test

Signed-off-by: lhy1024 <[email protected]>

* fix lint

Signed-off-by: lhy1024 <[email protected]>

---------

Signed-off-by: lhy1024 <[email protected]>
…ges (tikv#71)

* rename

Signed-off-by: HunDunDM <[email protected]>

* update SetAvailability

Signed-off-by: HunDunDM <[email protected]>

* move storeCondition

Signed-off-by: HunDunDM <[email protected]>

* address comment

Signed-off-by: HunDunDM <[email protected]>

* tiny fix

Signed-off-by: HunDunDM <[email protected]>

* fix merge

Signed-off-by: HunDunDM <[email protected]>

---------

Signed-off-by: HunDunDM <[email protected]>
Signed-off-by: lhy1024 <[email protected]>
* fix ObserveAvailableRegion bug

Signed-off-by: HunDunDM <[email protected]>

* fix test

Signed-off-by: HunDunDM <[email protected]>

* add comment

Signed-off-by: HunDunDM <[email protected]>

---------

Signed-off-by: HunDunDM <[email protected]>
Signed-off-by: lhy1024 <[email protected]>
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Dec 10, 2025

[FORMAT CHECKER NOTIFICATION]

Notice: To remove the do-not-merge/needs-linked-issue label, please provide the linked issue number on one line in the PR body, for example: Issue Number: close #123 or Issue Number: ref #456, multiple issues should use full syntax for each issue and be separated by a comma, like: Issue Number: close #123, ref #456.

📖 For more info, you can check the "Linking issues" section in the CONTRIBUTING.md.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dco-signoff: yes Indicates the PR's author has signed the dco. do-not-merge/needs-linked-issue do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. ok-to-test Indicates a PR is ready to be tested. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants