Skip to content

raftstore: remove stale ranges by DeleteByKeys rather than ingesting. (#18040)#18461

Merged
ti-chi-bot[bot] merged 5 commits intotikv:release-7.5from
ti-chi-bot:cherry-pick-18040-to-release-7.5
Jul 9, 2025
Merged

raftstore: remove stale ranges by DeleteByKeys rather than ingesting. (#18040)#18461
ti-chi-bot[bot] merged 5 commits intotikv:release-7.5from
ti-chi-bot:cherry-pick-18040-to-release-7.5

Conversation

@ti-chi-bot
Copy link
Member

This is an automated cherry-pick of #18040

What is changed and how it works?

Issue Number: Close #18107, Ref #18042

This PR mainly contains the following parts for optimization on scaling, used to mitigate the impacts, introduced by unnecessary ingesting sst files:

  • Directly clearing stale ranges by DeleteByKeys during the balancing regions process.
  • Do not clear data of offline stores during the scale-in process, as this data will be automatically cleared when the corresponding node goes offline.

What's Changed:

Optimizing the processing of clearing stale-ranges by DeleteByKeys, rather than ingesting.

This optimization is used to mitigate the impacts, introduced by unnecessary ingesting sst
files on latency when scaling.

Related changes

  • PR to update pingcap/docs/pingcap/docs-cn:
  • Need to cherry-pick to the release branch

Check List

Tests

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

Taking the grpc messages duration in TiKV metrics panel as examples, positive performance feedbacks on reducing the long-tail latency can be reviewed from the following comparison results:

Commit Comparisons on grpc messages duration
master image
This PR image

Meanwhile, the following E2E long-tail reduction also proves that this PR makes positive improvements effects:

Commit Scale-Out (Before -> Scaling) Scale-in (Before -> Scaling)
master P99: 7.2ms -> ~ 11.3 ms P999: 62ms -> ~89.2 ms P99: 7.2ms -> ~ 16.1 ms P999: 62ms -> ~100 ms
This PR P99: 7.2 ms -> ~10.6 ms P999: 62 ms -> ~76.9ms P99: 7.2ms -> ~ 15.3 ms P999: 62ms -> ~96 ms

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Release note

Optimizing the processing of clearing stale-ranges by DeleteByKeys to mitigate the impacts
on latency.

ref tikv#18042, close tikv#18107

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@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 Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. type/cherry-pick-for-release-7.5 This PR is cherry-picked to release-7.5 from a source PR. labels May 16, 2025
@ti-chi-bot
Copy link
Member Author

@LykxSassinator 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.

Signed-off-by: lucasliang <nkcs_lykx@hotmail.com>
Signed-off-by: lucasliang <nkcs_lykx@hotmail.com>
Signed-off-by: lucasliang <nkcs_lykx@hotmail.com>
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Jun 19, 2025

@hhwyt: adding LGTM is restricted to approvers and reviewers in OWNERS files.

Details

In response to this:

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-sigs/prow repository.

@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Jun 19, 2025
@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 Jul 3, 2025
@LykxSassinator
Copy link
Contributor

/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 Jul 7, 2025
Signed-off-by: lucasliang <nkcs_lykx@hotmail.com>
@LykxSassinator
Copy link
Contributor

/retest

@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Jul 9, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: glorv, hhwyt, LykxSassinator

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:
  • OWNERS [LykxSassinator,glorv]

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 added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Jul 9, 2025
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Jul 9, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-06-19 06:01:33.158671785 +0000 UTC m=+337945.881850765: ☑️ agreed by LykxSassinator.
  • 2025-07-09 08:07:14.782486904 +0000 UTC m=+2073487.505665885: ☑️ agreed by glorv.

@hhwyt
Copy link
Contributor

hhwyt commented Jul 9, 2025

/merge

@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Jul 9, 2025

@hhwyt: We have migrated to builtin LGTM and approve plugins for reviewing.

👉 Please use /approve when you want approve this pull request.

The changes announcement: Proposal: Strengthen configuration change approval.

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 ti-chi-bot bot merged commit 192b82b into tikv:release-7.5 Jul 9, 2025
4 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 Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. type/cherry-pick-for-release-7.5 This PR is cherry-picked to release-7.5 from a source PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants