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: Implement coprocessor observer post_exec_admin(query) #12850

Merged
merged 20 commits into from Jul 18, 2022

Conversation

CalvinNeo
Copy link
Member

@CalvinNeo CalvinNeo commented Jun 20, 2022

What is changed and how it works?

Issue Number: ref #12849

What's Changed:

According to #12849, we need to support some new observers, including post_exec_admin(query) which is implemented in this PR.

Support new observers post_exec_admin(query).

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
    • Consumes more MEM
  • Breaking backward compatibility

Release note

None

Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
@ti-chi-bot
Copy link
Member

ti-chi-bot commented Jun 20, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • BusyJay
  • tonyxuqqi

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.

@CalvinNeo
Copy link
Member Author

/run-all-tests

@@ -1323,6 +1346,10 @@ where
}
}

if should_write {
info!("persist data and apply state"; "region_id" => self.region_id(), "peer_id" => self.id(), "state" => ?self.apply_state);
ctx.commit(self);
Copy link
Member Author

Choose a reason for hiding this comment

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

Should we move this into an outer function?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, otherwise the response won't be returned for the last command.

Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
@CalvinNeo
Copy link
Member Author

/cc @BusyJay @tonyxuqqi

Copy link
Contributor

@tonyxuqqi tonyxuqqi left a comment

Choose a reason for hiding this comment

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

Add some test for changes in apply.rs

@CalvinNeo
Copy link
Member Author

CalvinNeo commented Jun 29, 2022

Add some test for changes in apply.rs

Will do that after pre_exec_query(admin) are merged in test_exec_observer.

Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
@CalvinNeo CalvinNeo marked this pull request as ready for review June 30, 2022 02:14
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
@ti-chi-bot ti-chi-bot added the status/LGT1 Status: PR - There is already 1 approval label Jul 6, 2022
@CalvinNeo CalvinNeo requested a review from BusyJay July 12, 2022 03:35
CalvinNeo and others added 6 commits July 12, 2022 13:26
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
f
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
Copy link
Member

@BusyJay BusyJay left a comment

Choose a reason for hiding this comment

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

I think we need to bench the performance impact after adding two observers. sysbench should be enough.

@@ -1323,6 +1346,10 @@ where
}
}

if should_write {
info!("persist data and apply state"; "region_id" => self.region_id(), "peer_id" => self.id(), "state" => ?self.apply_state);
ctx.commit(self);
Copy link
Member

Choose a reason for hiding this comment

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

Yes, otherwise the response won't be returned for the last command.

f
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
@CalvinNeo
Copy link
Member Author

/build

@CalvinNeo
Copy link
Member Author

/run-build-arm64 comment=true

@CalvinNeo
Copy link
Member Author

I think we need to bench the performance impact after adding two observers. sysbench should be enough.
It is tested that the performance is quite close to each other.
VHH72SaHAz

@CalvinNeo CalvinNeo requested a review from BusyJay July 16, 2022 03:10
@ti-chi-bot ti-chi-bot added status/LGT2 Status: PR - There are already 2 approvals and removed status/LGT1 Status: PR - There is already 1 approval labels Jul 16, 2022
@breezewish
Copy link
Member

/merge

@ti-chi-bot
Copy link
Member

@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 /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
Member

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

Commit hash: d8a6323

@ti-chi-bot ti-chi-bot added the status/can-merge Status: Can merge to base branch label Jul 18, 2022
@ti-chi-bot ti-chi-bot merged commit 21f00d2 into tikv:master Jul 18, 2022
@ti-chi-bot ti-chi-bot added this to the Pool milestone Jul 18, 2022
CalvinNeo added a commit to CalvinNeo/tidb-engine-ext that referenced this pull request Jul 18, 2022
…v#12850)

ref tikv#12849

Support new observers post_exec_admin(query).

Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>

Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
@sre-bot
Copy link
Contributor

sre-bot commented Aug 5, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution Type: PR - From contributors first-time-contributor 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

6 participants