Skip to content

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

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

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

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.1 This PR is cherry-picked to release-8.1 from a source PR. labels Feb 28, 2025
@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 Feb 28, 2025
Signed-off-by: glorv <[email protected]>
@glorv

glorv commented Mar 3, 2025

Copy link
Copy Markdown
Contributor

/retest

@glorv glorv requested a review from Connor1996 March 3, 2025 04:16
@glorv

glorv commented Mar 3, 2025

Copy link
Copy Markdown
Contributor

/retest
/test

@ti-chi-bot

ti-chi-bot Bot commented Mar 3, 2025

Copy link
Copy Markdown
Contributor

@glorv: The /test command needs one or more targets.
The following commands are available to trigger required jobs:

/test pull-unit-test

The following commands are available to trigger optional jobs:

/debug pull-integration-test

Use /test all to run the following jobs that were automatically triggered:

tikv/tikv/release-8.1/pull_unit_test
Details

In response to this:

/retest
/test

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.

@glorv

glorv commented Mar 3, 2025

Copy link
Copy Markdown
Contributor

/test pull-unit-test

@glorv

glorv commented Mar 3, 2025

Copy link
Copy Markdown
Contributor

/test all

@glorv

glorv commented Mar 3, 2025

Copy link
Copy Markdown
Contributor

/retest

@ti-chi-bot ti-chi-bot Bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Mar 4, 2025
@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 added approved and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Mar 4, 2025
@ti-chi-bot

ti-chi-bot Bot commented Mar 4, 2025

Copy link
Copy Markdown
Contributor

[LGTM Timeline notifier]

Timeline:

  • 2025-03-04 02:25:57.669245017 +0000 UTC m=+322070.798164762: ☑️ agreed by hbisheng.
  • 2025-03-04 02:37:00.98314549 +0000 UTC m=+322734.112065231: ☑️ agreed by glorv.

@ti-chi-bot ti-chi-bot Bot merged commit 9fe3f6f into tikv:release-8.1 Mar 4, 2025
@glorv glorv deleted the cherry-pick-18241-to-release-8.1 branch March 4, 2025 02:40
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.1 This PR is cherry-picked to release-8.1 from a source PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants