Skip to content

raftstore: optimize hibernate condition (#19082)#19183

Merged
ti-chi-bot[bot] merged 2 commits intotikv:release-8.5from
ti-chi-bot:cherry-pick-19082-to-release-8.5
Dec 12, 2025
Merged

raftstore: optimize hibernate condition (#19082)#19183
ti-chi-bot[bot] merged 2 commits intotikv:release-8.5from
ti-chi-bot:cherry-pick-19082-to-release-8.5

Conversation

@ti-chi-bot
Copy link
Member

This is an automated cherry-pick of #19082

What is changed and how it works?

Issue Number: Close #19070

What's Changed:

1. Hibernate condition optimization: leader no need wait for all peers' hibernate votes if any non-voter peer is down and votes reach majority.  
2. If non hibernate vote peers are all unreachable, leader can skip broadcasting hibernate request. This can reduce the number of messages before down peer is detected (10min by default).  

As noted in #19070, when a TiKV peer becomes unavailable, region leaders on other nodes are prevented from entering hibernation due to the current condition logic—which requires the leader to receive votes from all peers before hibernating. This requirement is overly strict. In practice, the leader only needs to confirm that it has received votes from all alive peers(referencing the down_peers field) and that a majority has been reached for raft voters.

Before Modification
image

After Modification
image

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

Hibernate condition optimization: leader no need wait for all peers' hibernate votes if any non-voter peer is down and votes reach majority.    

close tikv#19070

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot ti-chi-bot added contribution This PR is from a community contributor. 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. first-time-contributor Indicates that the PR was contributed by an external member and is a first-time contributor. 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/XXL Denotes a PR that changes 1000+ 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 Dec 8, 2025
@jiadebin
Copy link
Contributor

jiadebin commented Dec 8, 2025

/cherry-pick-invite

@ti-chi-bot
Copy link
Member Author

@jiadebin you're not a member of org tikv

@jiadebin
Copy link
Contributor

jiadebin commented Dec 8, 2025

/ok-to-test

@jiadebin jiadebin force-pushed the cherry-pick-19082-to-release-8.5 branch from fabad43 to c21fd74 Compare December 9, 2025 04:08
Signed-off-by: Debin <debin.jia@pingcap.com>
@jiadebin jiadebin force-pushed the cherry-pick-19082-to-release-8.5 branch from c21fd74 to a9915ef Compare December 9, 2025 05:39
@jiadebin
Copy link
Contributor

jiadebin commented Dec 9, 2025

/ok-to-test

@jiadebin
Copy link
Contributor

jiadebin commented Dec 9, 2025

/cc @Connor1996 @overvenus

@ti-chi-bot ti-chi-bot bot requested review from Connor1996 and overvenus December 9, 2025 06:29
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 needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Dec 10, 2025
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Dec 10, 2025

[APPROVALNOTIFIER] This PR is APPROVED

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

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

ti-chi-bot bot commented Dec 10, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-12-10 09:12:36.87916111 +0000 UTC m=+1032301.692938672: ☑️ agreed by Connor1996.
  • 2025-12-10 09:17:13.780097751 +0000 UTC m=+1032578.593875333: ☑️ agreed by overvenus.

@ti-chi-bot ti-chi-bot bot added the cherry-pick-approved Cherry pick PR approved by release team. label Dec 10, 2025
@hbisheng
Copy link
Member

/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 Dec 12, 2025
@ti-chi-bot ti-chi-bot bot merged commit 9c3e19b into tikv:release-8.5 Dec 12, 2025
5 checks passed
@ti-chi-bot ti-chi-bot bot deleted the cherry-pick-19082-to-release-8.5 branch December 12, 2025 02:30
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. contribution This PR is from a community contributor. dco-signoff: yes Indicates the PR's author has signed the dco. first-time-contributor Indicates that the PR was contributed by an external member and is a first-time contributor. 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/XXL Denotes a PR that changes 1000+ 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.

5 participants