tikv icon indicating copy to clipboard operation
tikv copied to clipboard

raftstore-v2: implement local read for raftstore-v2

Open SpadeA-Tang opened this issue 3 years ago • 3 comments

What is changed and how it works?

Issue Number: Ref #12842

What's Changed:

This PR involves:

  • Refactor LocalReader of raftstore-v1 to make some code sharable with raftstore-v2
  • Implement LocalReader of raftstore-v2 and add relevant tests
  • Replace callback with ReadCallback trait

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

Release note

None

SpadeA-Tang avatar Aug 30 '22 03:08 SpadeA-Tang

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • 5kbpers
  • 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.

ti-chi-bot avatar Aug 30 '22 03:08 ti-chi-bot

/test

SpadeA-Tang avatar Sep 21 '22 10:09 SpadeA-Tang

/test

SpadeA-Tang avatar Oct 08 '22 15:10 SpadeA-Tang

/merge

5kbpers avatar Oct 11 '22 08:10 5kbpers

@5kbpers: 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 avatar Oct 11 '22 08:10 ti-chi-bot

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

Commit hash: 0ee256b7e5afe2fe03bf67e949ffb4b0842b0c20

ti-chi-bot avatar Oct 11 '22 08:10 ti-chi-bot

/test

SpadeA-Tang avatar Oct 11 '22 08:10 SpadeA-Tang

Why merge this? I think it depends on #13568

BusyJay avatar Oct 11 '22 10:10 BusyJay

Why merge this? I think it depends on #13568

The circumstance here is much easier. It only has snap oepration and does not have cache.

SpadeA-Tang avatar Oct 11 '22 10:10 SpadeA-Tang

The circumstance here is much easier. It only has snap oepration and does not have cache.

It doesn't have cross snapshot cache, but it may has cache within the same region. And this PR also lacks the check of last_valid_ts.

BusyJay avatar Oct 11 '22 10:10 BusyJay

The circumstance here is much easier. It only has snap oepration and does not have cache.

It doesn't have cross snapshot cache, but it may has cache within the same region. And this PR also lacks the check of last_valid_ts.

Checking last_valid_ts means we have to acquire the system time twice? One before getting the snapshot and one after it.

SpadeA-Tang avatar Oct 11 '22 10:10 SpadeA-Tang

Checking last_valid_ts means we have to acquire the system time twice? One before getting the snapshot and one after it.

Yes, for V1. For v2, only check if latest tablet is None is sufficient.

BusyJay avatar Oct 11 '22 10:10 BusyJay