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

scheduler: use move-hot-write-leader operator #7852

Merged
merged 7 commits into from
Apr 12, 2024

Conversation

lhy1024
Copy link
Contributor

@lhy1024 lhy1024 commented Feb 26, 2024

What problem does this PR solve?

Issue Number: Close #7848

What is changed and how does it work?

Check List

Tests

  • Unit test
  • manual test with 6 tikv
    • tpcc
      image
    • oltp_read_write
      image
    • oltp_write_only
      image
    • oltp_update_index
      image
    • oltp_update_non_index
      image
    • oltp_insert
      image

Release note

None.

@lhy1024 lhy1024 requested a review from rleungx February 26, 2024 04:28
Copy link
Contributor

ti-chi-bot bot commented Feb 26, 2024

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • HuSharp
  • rleungx

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 bot added release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Feb 26, 2024
Copy link

codecov bot commented Feb 26, 2024

Codecov Report

Merging #7852 (b7fc80e) into master (1cd99f1) will decrease coverage by 0.04%.
The diff coverage is 91.11%.

❗ Current head b7fc80e differs from pull request most recent head 5462b89. Consider uploading reports for the commit 5462b89 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7852      +/-   ##
==========================================
- Coverage   77.25%   77.22%   -0.04%     
==========================================
  Files         468      468              
  Lines       60937    60872      -65     
==========================================
- Hits        47078    47009      -69     
- Misses      10302    10307       +5     
+ Partials     3557     3556       -1     
Flag Coverage Δ
unittests 77.22% <91.11%> (-0.04%) ⬇️

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

Signed-off-by: lhy1024 <[email protected]>
// peer in store 1 of the region 2 can transfer to store 5 or store 6 because of the label
operatorutil.CheckTransferPeerWithLeaderTransferFrom(re, op, operator.OpHotRegion, 1)
} else {
re.Equal("move-hot-write-leader", op.Desc())
re.Equal(5, op.Len())
Copy link
Member

Choose a reason for hiding this comment

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

why is the length different?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

#7872 Move leader without joint will appear as an extra transfer leader, I'll try to adjust the test firstly to make it look more reasonable

@tikv tikv deleted a comment from ti-chi-bot bot Mar 7, 2024
@ti-chi-bot ti-chi-bot added needs-cherry-pick-release-6.5 Should cherry pick this PR to release-6.5 branch. and removed needs-cherry-pick-release-6.5 Should cherry pick this PR to release-6.5 branch. labels Mar 31, 2024
@ti-chi-bot ti-chi-bot added the needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. label Apr 11, 2024
} else {
re.Equal("move-hot-write-leader", op.Desc())
Copy link
Member

Choose a reason for hiding this comment

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

no need it?

@ti-chi-bot ti-chi-bot bot added the status/LGT1 Indicates that a PR has LGTM 1. label Apr 11, 2024
@@ -5881,6 +5881,21 @@
"intervalFactor": 1,
"legendFormat": "store-{{store}}-in",
"refId": "B"
},
{
"expr": "- sum(delta(pd_scheduler_hot_region_direction{k8s_cluster=\"$k8s_cluster\", tidb_cluster=\"$tidb_cluster\", store=~\"$store\",type=\"move-leader\",direction=\"out\",rw=\"write\"}[1m]))by (store)",
Copy link
Member

Choose a reason for hiding this comment

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

can you paste the grafana pic?

Suggested change
"expr": "- sum(delta(pd_scheduler_hot_region_direction{k8s_cluster=\"$k8s_cluster\", tidb_cluster=\"$tidb_cluster\", store=~\"$store\",type=\"move-leader\",direction=\"out\",rw=\"write\"}[1m]))by (store)",
"expr": "sum(delta(pd_scheduler_hot_region_direction{k8s_cluster=\"$k8s_cluster\", tidb_cluster=\"$tidb_cluster\", store=~\"$store\",type=\"move-leader\",direction=\"out\",rw=\"write\"}[1m]))by (store)",

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It should be negative, because its direction is out

Copy link
Member

Choose a reason for hiding this comment

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

got it.

@@ -88,32 +104,36 @@ func CheckTransferLearner(re *require.Assertions, op *operator.Operator, kind op
// CheckTransferPeerWithLeaderTransfer checks if the operator is to transfer
// peer between the specified source and target stores and it meanwhile
// transfers the leader out of source store.
// If targetID is 0, it means the operator is to transfer peer to any store.
func CheckTransferPeerWithLeaderTransfer(re *require.Assertions, op *operator.Operator, kind operator.OpKind, sourceID, targetID uint64) {
Copy link
Member

Choose a reason for hiding this comment

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

Do we need to add more comments to indicate these functions are used for the test?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe I will refactor them in another pr.

@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 Apr 11, 2024
@lhy1024
Copy link
Contributor Author

lhy1024 commented Apr 12, 2024

/merge

Copy link
Contributor

ti-chi-bot bot commented Apr 12, 2024

@lhy1024: 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.

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.

Copy link
Contributor

ti-chi-bot bot commented Apr 12, 2024

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

Commit hash: b7fc80e

@ti-chi-bot ti-chi-bot bot added the status/can-merge Indicates a PR has been approved by a committer. label Apr 12, 2024
Copy link
Contributor

ti-chi-bot bot commented Apr 12, 2024

@lhy1024: 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 33ae3b6 into tikv:master Apr 12, 2024
22 checks passed
@ti-chi-bot
Copy link
Member

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

ti-chi-bot pushed a commit to ti-chi-bot/pd that referenced this pull request Apr 12, 2024
ti-chi-bot bot pushed a commit that referenced this pull request Apr 15, 2024
close #7848

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

Co-authored-by: lhy1024 <[email protected]>
Co-authored-by: lhy1024 <[email protected]>
@ti-chi-bot ti-chi-bot added the needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. label May 7, 2024
ti-chi-bot pushed a commit to ti-chi-bot/pd that referenced this pull request May 7, 2024
@ti-chi-bot
Copy link
Member

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

ti-chi-bot bot pushed a commit that referenced this pull request May 20, 2024
close #7848

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

Co-authored-by: lhy1024 <[email protected]>
Co-authored-by: lhy1024 <[email protected]>
@lhy1024 lhy1024 added the needs-cherry-pick-release-6.5 Should cherry pick this PR to release-6.5 branch. label Jun 4, 2024
@lhy1024 lhy1024 deleted the move-hot-write-leader branch June 4, 2024 03:17
ti-chi-bot pushed a commit to ti-chi-bot/pd that referenced this pull request Jun 4, 2024
@ti-chi-bot
Copy link
Member

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

@ti-chi-bot ti-chi-bot added the needs-cherry-pick-release-8.1 Should cherry pick this PR to release-8.1 branch. label Jul 29, 2024
@ti-chi-bot
Copy link
Member

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

ti-chi-bot pushed a commit to ti-chi-bot/pd that referenced this pull request Jul 29, 2024
ti-chi-bot bot pushed a commit that referenced this pull request Jul 29, 2024
close #7848

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

Co-authored-by: lhy1024 <[email protected]>
Co-authored-by: lhy1024 <[email protected]>
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.5 Should cherry pick this PR to release-7.5 branch. needs-cherry-pick-release-8.1 Should cherry pick this PR to release-8.1 branch. release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 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.

Hot write may break the constraint of placement policy
4 participants