Skip to content

raftstore: fix reset follow apply_unpersisted_log_limit when demoting from leader (#18241)#18260

Merged
ti-chi-bot[bot] merged 6 commits into
tikv:release-8.5from
ti-chi-bot:cherry-pick-18241-to-release-8.5
Mar 4, 2025
Merged

raftstore: fix reset follow apply_unpersisted_log_limit when demoting from leader (#18241)#18260
ti-chi-bot[bot] merged 6 commits into
tikv:release-8.5from
ti-chi-bot:cherry-pick-18241-to-release-8.5

Conversation

@ti-chi-bot

Copy link
Copy Markdown
Member

This is an automated cherry-pick of #18241

What is changed and how it works?

Issue Number: Close #17868, ref #16717

What's Changed:

NOTE: this PR depends on PR tikv/raft-rs#561

This PR adopt the changes in https://github.com/tikv/raft-rs/pull/561 that directly reset the apply_unpersisted_log_limit limit in raft when leader is demoted. It fix the bug that in the previous impl, the reset is done in "on_role_change" which is called in handle_raft_ready, in the round that leader is demoted, it still return unpersisted comitted entries as at the time, the limit is not reset.
NOTE: once we want to support this feature on follower, we need to remove the original assert as it is incorrect in this case.

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

@ti-chi-bot ti-chi-bot added dco-signoff: yes Indicates the PR's author has signed the dco. 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. type/cherry-pick-for-release-8.5 This PR is cherry-picked to release-8.5 from a source PR. labels Feb 28, 2025
@ti-chi-bot ti-chi-bot Bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Feb 28, 2025
@glorv glorv requested a review from Connor1996 February 28, 2025 09:21
@ti-chi-bot ti-chi-bot Bot added the lgtm label Mar 4, 2025
@ti-chi-bot

ti-chi-bot Bot commented Mar 4, 2025

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

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

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 Mar 4, 2025
@ti-chi-bot

ti-chi-bot Bot commented Mar 4, 2025

Copy link
Copy Markdown
Contributor

[LGTM Timeline notifier]

Timeline:

  • 2025-02-28 08:47:45.219657002 +0000 UTC m=+604813.172815271: ☑️ agreed by glorv.
  • 2025-03-04 02:27:43.488274165 +0000 UTC m=+322176.617193906: ☑️ agreed by hbisheng.

@ti-chi-bot ti-chi-bot Bot merged commit dca849f into tikv:release-8.5 Mar 4, 2025
@glorv glorv deleted the cherry-pick-18241-to-release-8.5 branch March 4, 2025 02:36
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-none Denotes a PR that doesn't merit a release note. 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