Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

raftstore-v2: add replay watch #14739

Merged
merged 8 commits into from May 25, 2023
Merged

raftstore-v2: add replay watch #14739

merged 8 commits into from May 25, 2023

Conversation

tonyxuqqi
Copy link
Contributor

@tonyxuqqi tonyxuqqi commented May 11, 2023

What is changed and how it works?

Issue Number: Ref #14173

What's Changed:

This is part of the code from PR 14501.  This change is to record the actual time of the replay raft log. 

Related changes

  • PR to update pingcap/docs/pingcap/docs-cn:
  • Need to cherry-pick to the release branch

Check List

Tests

  • No code

Release note

None

Signed-off-by: qi.xu <tonxuqi@outlook.com>
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented May 11, 2023

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • SpadeA-Tang
  • tabokie

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

components/raftstore-v2/src/operation/ready/mod.rs Outdated Show resolved Hide resolved
components/raftstore-v2/src/raft/peer.rs Show resolved Hide resolved
components/raftstore-v2/src/operation/ready/mod.rs Outdated Show resolved Hide resolved
true
} else {
if let Some(w) = watch {
w.record_skipped();
Copy link
Member

Choose a reason for hiding this comment

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

Why is it called "skipped"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's "skipped" the pause for replay as it's not needed.

Copy link
Member

Choose a reason for hiding this comment

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

It is confusing. For "pause", it means the replay is paused. But for "skipped", it doesn't mean replay is skipped, it means "pause-for-replay" is skipped.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point. It's renamed to "normal_peers" and "paused_peers", which seems better. @tabokie

@wuhuizuo
Copy link
Contributor

/review default

@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented May 15, 2023

@wuhuizuo:

Pull Request Review for "raftstore-v2: add replay watch"

Summary of Changes

  • Added ReplayWatch struct in module operation::ready, which helps to record the actual time of replaying raft log.
  • Implemented a new on_start method in PeerFsmDelegate which accepts an optional ReplayWatch.
  • Updated several other methods and structs to incorporate ReplayWatch.
  • Made changes in the StoreSystem to use ReplayWatch when sending PeerMsg::Start to all FSMs.

Potential Problems

  1. There might be a possible issue with the new on_start method in PeerFsmDelegate where not all FSMs are pausing when they should.
  2. The use of Atomic operations for the counters in ReplayWatch might possibly impact performance.

Suggestions for Fixes

  1. Ensure that the newly implemented on_start method is properly handling FSMs pausing for recovery.
  2. Consider benchmarking and profiling to analyze the impact of using Atomic operations in the ReplayWatch and make adjustments if necessary.


<details>

In response to [this](https://github.com/tikv/tikv/pull/14739#issuecomment-1547755177):

>/review default


Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
</details>

tonyxuqqi and others added 3 commits May 23, 2023 10:52
Co-authored-by: Xinye Tao <xy.tao@outlook.com>
Signed-off-by: tonyxuqqi <tonyxuqi@outlook.com>
Signed-off-by: Qi Xu <tonyxuqqi@outlook.com>
@tonyxuqqi
Copy link
Contributor Author

/test

Signed-off-by: Qi Xu <tonyxuqqi@outlook.com>
Copy link
Member

@SpadeA-Tang SpadeA-Tang left a comment

Choose a reason for hiding this comment

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

rest LGTM

@ti-chi-bot ti-chi-bot bot added the status/LGT1 Status: PR - There is already 1 approval label May 24, 2023
Qi Xu and others added 2 commits May 24, 2023 17:08
Signed-off-by: Qi Xu <tonyxuqqi@outlook.com>
@ti-chi-bot ti-chi-bot bot added status/LGT2 Status: PR - There are already 2 approvals and removed status/LGT1 Status: PR - There is already 1 approval labels May 25, 2023
@tonyxuqqi
Copy link
Contributor Author

/merge

@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented May 25, 2023

@tonyxuqqi: It seems you want to merge this PR, I will help you trigger all the tests:

/run-all-tests

You only need to trigger /merge once, and if the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

If you have any questions about the PR merge process, please refer to pr process.

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 ti-community-infra/tichi repository.

@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented May 25, 2023

This pull request has been accepted and is ready to merge.

Commit hash: 089e9c6

@ti-chi-bot ti-chi-bot bot added the status/can-merge Status: Can merge to base branch label May 25, 2023
@ti-chi-bot ti-chi-bot bot merged commit 7f9aaf7 into tikv:master May 25, 2023
6 of 7 checks passed
@ti-chi-bot ti-chi-bot bot added this to the Pool milestone May 25, 2023
@ti-chi-bot
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-cherry-pick-release-7.1 release-note-none size/L status/can-merge Status: Can merge to base branch status/LGT2 Status: PR - There are already 2 approvals
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants