Skip to content

raftstore: fix the corner case if entering hiberate state without correctly clearing busy_on_apply state.#19199

Merged
ti-chi-bot[bot] merged 2 commits intotikv:masterfrom
LykxSassinator:fix_18233_busy_on_apply
Dec 12, 2025
Merged

raftstore: fix the corner case if entering hiberate state without correctly clearing busy_on_apply state.#19199
ti-chi-bot[bot] merged 2 commits intotikv:masterfrom
LykxSassinator:fix_18233_busy_on_apply

Conversation

@LykxSassinator
Copy link
Contributor

@LykxSassinator LykxSassinator commented Dec 11, 2025

What is changed and how it works?

Issue Number: Close #18233

What's Changed:

As mentioned in #18233 (comment), there still exists some corner cases that the previous works cannot address effectively.

This PR is the last vaccine to fix the corner case that some hibernate peers cannot clear their busy_on_apply state timely, based on the previous work in #18236.

Fix the corner case that some hibernate peers cannot clear their `busy_on_apply` state timely.

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

None.

…rectly clearing `busy_on_apply` state.

Signed-off-by: lucasliang <nkcs_lykx@hotmail.com>
Copilot AI review requested due to automatic review settings December 11, 2025 10:25
@ti-chi-bot ti-chi-bot bot added dco-signoff: yes Indicates the PR's author has signed the dco. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Dec 11, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a corner case where hibernate peers fail to clear their busy_on_apply state in a timely manner. The fix adds two strategic calls to on_check_peer_complete_apply_logs() to ensure the state is properly checked and cleared during hibernation scenarios.

  • Adds busy_on_apply check after updating leader committed index to catch hibernating peers that receive updates
  • Adds busy_on_apply check before responding to hibernate requests to ensure proper state cleanup before entering hibernation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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. release-note-none Denotes a PR that doesn't merit a release note. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Dec 12, 2025
@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Dec 12, 2025
@ti-chi-bot ti-chi-bot bot added the lgtm label Dec 12, 2025
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Dec 12, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hbisheng, overvenus

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 removed the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Dec 12, 2025
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Dec 12, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-12-12 12:28:56.673139804 +0000 UTC m=+1216881.486917376: ☑️ agreed by overvenus.
  • 2025-12-12 13:03:22.085475291 +0000 UTC m=+1218946.899252863: ☑️ agreed by hbisheng.

@ti-chi-bot ti-chi-bot bot merged commit a527e8c into tikv:master Dec 12, 2025
9 checks passed
@ti-chi-bot ti-chi-bot bot added this to the Pool milestone Dec 12, 2025
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Dec 12, 2025

@LykxSassinator: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-unit-test dc69f91 link unknown /test pull-unit-test

Full PR test history. Your PR dashboard.

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 kubernetes-sigs/prow repository. I understand the commands that are listed here.

@LykxSassinator LykxSassinator added the needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. label Dec 12, 2025
@ti-chi-bot
Copy link
Member

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

ti-chi-bot bot pushed a commit that referenced this pull request Dec 14, 2025
…rectly clearing `busy_on_apply` state. (#19199) (#19202)

close #18233, close #19203

Fix the corner case that some hibernate peers cannot clear their `busy_on_apply` state timely.

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

Co-authored-by: lucasliang <nkcs_lykx@hotmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved dco-signoff: yes Indicates the PR's author has signed the dco. lgtm needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Raft peers may get stuck in busy apply state post TiKV startup

5 participants