Skip to content

raftstore: avoid early hibernate if pending on applying logs when restart (#18236)#18393

Merged
ti-chi-bot[bot] merged 5 commits intotikv:release-8.5from
ti-chi-bot:cherry-pick-18236-to-release-8.5
Apr 16, 2025
Merged

raftstore: avoid early hibernate if pending on applying logs when restart (#18236)#18393
ti-chi-bot[bot] merged 5 commits intotikv:release-8.5from
ti-chi-bot:cherry-pick-18236-to-release-8.5

Conversation

@ti-chi-bot
Copy link
Member

This is an automated cherry-pick of #18236

What is changed and how it works?

Issue Number: Close #18233

What's Changed:

In previous work #16239, we introduced the busy_on_apply state to indicate
whether a Peer is pending the application of pending Raft logs upon restart.

However, this approach misses a corner case: if the Peer quickly enters the
hibernate state after restarting, the busy_on_apply state may not be updated
in a timely manner. This results in the Node failed to update the count of pending
applying regions, continuously reporting an incorrect is_busy == true state to PD.
Consequently, this can slow down the rolling-restart progress more than expected.

Therefore, this PR addresses this issue by updating the applied state in on_apply_res.

Fix the bug where some hibernated peers, marked with `busy_on_apply == true`, 
cannot be reset with normal even thought the `applied_index == committed_index`.

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

Side effects

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

Release note

Fix the bug where some hibernated peers, marked with `busy_on_apply == true`, 
cannot be reset with normal even thought the `applied_index == committed_index`.

…tart.

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 ti-chi-bot added dco-signoff: yes Indicates the PR's author has signed the dco. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 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 Apr 14, 2025
Signed-off-by: lucasliang <nkcs_lykx@hotmail.com>
@ti-chi-bot ti-chi-bot bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 15, 2025
This reverts commit e603abb.

Signed-off-by: lucasliang <nkcs_lykx@hotmail.com>
Copy link
Member

@Connor1996 Connor1996 left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-chi-bot ti-chi-bot bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Apr 15, 2025
@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Apr 15, 2025
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Apr 15, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-04-15 08:15:32.127101005 +0000 UTC m=+2762625.811337085: ☑️ agreed by Connor1996.
  • 2025-04-15 10:44:33.473556957 +0000 UTC m=+2771567.157793048: ☑️ agreed by LykxSassinator.

@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 Apr 15, 2025
@LykxSassinator
Copy link
Contributor

/ok-to-test

@ti-chi-bot ti-chi-bot bot added the ok-to-test Indicates a PR is ready to be tested. label Apr 16, 2025
@LykxSassinator
Copy link
Contributor

/approve

@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Apr 16, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Connor1996, 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 [Connor1996,LykxSassinator]

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 merged commit 4af1758 into tikv:release-8.5 Apr 16, 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 ok-to-test Indicates a PR is ready to be tested. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 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