Skip to content

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

Merged
ti-chi-bot[bot] merged 3 commits intotikv:release-8.5from
ti-chi-bot:cherry-pick-18040-to-release-8.5
Jul 7, 2025
Merged

raftstore: remove stale ranges by DeleteByKeys rather than ingesting. (#18040)#18622
ti-chi-bot[bot] merged 3 commits intotikv:release-8.5from
ti-chi-bot:cherry-pick-18040-to-release-8.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 affects-8.1 This bug affects the 8.1.x(LTS) versions. 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-8.5 This PR is cherry-picked to release-8.5 from a source PR. labels Jul 2, 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>
@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Jul 3, 2025
@LykxSassinator LykxSassinator removed the affects-8.1 This bug affects the 8.1.x(LTS) versions. label Jul 3, 2025
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Jul 3, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hbisheng, 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:

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 3, 2025
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Jul 3, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-07-03 02:26:51.380092968 +0000 UTC m=+1534664.103271937: ☑️ agreed by LykxSassinator.
  • 2025-07-03 02:45:08.459624198 +0000 UTC m=+1535761.182803179: ☑️ agreed by hbisheng.

@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
Signed-off-by: lucasliang <nkcs_lykx@hotmail.com>
@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
@ti-chi-bot ti-chi-bot bot merged commit a66825c into tikv:release-8.5 Jul 7, 2025
4 checks passed
@ti-chi-bot ti-chi-bot bot added do-not-merge/cherry-pick-not-approved cherry-pick-approved Cherry pick PR approved by release team. and removed cherry-pick-approved Cherry pick PR approved by release team. labels Jul 7, 2025
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-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.

3 participants