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: Implement coprocessor observer pre(post)_apply_snapshot #12889
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally LGTM
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rest LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the rest LGTM
@@ -763,6 +817,14 @@ where | |||
} | |||
task @ Task::Apply { .. } => { | |||
fail_point!("on_region_worker_apply", true, |_| {}); | |||
if self.ctx.coprocessor_host.should_pre_apply_snapshot() { | |||
if let Err(e) = self.ctx.pre_apply_snapshot(&task) { | |||
info!( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe warn?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think maybe we can just remove this log. Since:
- If the error is raised by check_abort, which means we just quit applying this snapshot, it is in expectation.
- If the error is because we have not finished receiving/persisting snapshot for now, it is also in expectation.
For the rear case, we can have a pre_apply_snapshot(.., None)
to notify, so we can print if we need in proxy code, though currently this is not necessary.
@@ -763,6 +817,14 @@ where | |||
} | |||
task @ Task::Apply { .. } => { | |||
fail_point!("on_region_worker_apply", true, |_| {}); | |||
if self.ctx.coprocessor_host.should_pre_apply_snapshot() { | |||
if let Err(e) = self.ctx.pre_apply_snapshot(&task) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these pre-apply-snapshots are handled in serial instead of concurrently?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are handled in parallel
…ine-ext into merge-tikv-pre-handle
/merge |
@breezewish: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests You only need to trigger 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. |
This pull request has been accepted and is ready to merge. Commit hash: 62a3e8e
|
@CalvinNeo: Your PR was out of date, I have automatically updated it for you. At the same time I will also trigger all tests for you: /run-all-tests 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. 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. |
…ikv#12889) ref tikv#12849 Support new observers pre(post)_apply_snapshot. Signed-off-by: CalvinNeo <calvinneo1995@gmail.com> Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
…ikv#12889) ref tikv#12849 Support new observers pre(post)_apply_snapshot. Signed-off-by: CalvinNeo <calvinneo1995@gmail.com> Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io> Signed-off-by: TonsnakeLin <lpbgytong@163.com>
…ikv#12889) ref tikv#12849 Support new observers pre(post)_apply_snapshot. Signed-off-by: CalvinNeo <calvinneo1995@gmail.com> Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io> Signed-off-by: TonsnakeLin <lpbgytong@163.com>
…ikv#12889) ref tikv#12849 Support new observers pre(post)_apply_snapshot. Signed-off-by: CalvinNeo <calvinneo1995@gmail.com> Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io> Signed-off-by: fengou1 <feng.ou@pingcap.com>
What is changed and how it works?
Issue Number: ref #12849
What's Changed:
Related changes
pingcap/docs
/pingcap/docs-cn
:Check List
Tests
Side effects
Release note