raftstore: Implement engine trait can_apply_snapshot#12924
raftstore: Implement engine trait can_apply_snapshot#12924ti-chi-bot merged 46 commits intotikv:masterfrom
Conversation
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
|
[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. DetailsReviewer can indicate their review by submitting an approval review. |
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
|
/run-all-tests |
2 similar comments
|
/run-all-tests |
|
/run-all-tests |
|
/run-all-tests |
|
/cc @BusyJay |
| self.shared_block_cache = enable; | ||
| } | ||
|
|
||
| pub fn get_shared_block_cache(&self) -> bool { |
There was a problem hiding this comment.
Should be shared_block_cache. Note we will remove the field in the future and cache will be always shared.
| /// Some KvEngines need to do some transforms before apply data from | ||
| /// snapshot. These procedures can be batched in background if there are | ||
| /// more than one incoming snapshots, thus not blocking applying thread. | ||
| fn can_apply_snapshot(&self, _is_timeout: bool, _region_id: u64) -> bool { |
There was a problem hiding this comment.
Why need is_timeout? How can it make any difference?
There was a problem hiding this comment.
If there is no incoming applying snapshot for a long time, handle_pending_applies can be triggered by on_timeout, thus proxy can do it directly in foreground.
There was a problem hiding this comment.
Then why bother calling can_apply_snapshot again when timeout?
There was a problem hiding this comment.
handle_pending_applies will apply multiple snapshots as long as it will not cause write stall. However, in proxy we won't handle the more than one snapshot if the following snapshot is still pre-handling, thus avoid continuous blocking of the thread for applying snapshot.
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
11d38f6 to
31ee9ca
Compare
31ee9ca to
3d73188
Compare
|
/run-all-tests |
|
/cc @breezewish |
|
The rest looks good to me. @tonyxuqqi PTAL, thanks! |
| const PENDING_APPLY_CHECK_INTERVAL: u64 = 200; | ||
| const STALE_PEER_CHECK_TICK: usize = 1; | ||
|
|
||
| fn make_raftstore_cfg(use_delete_range: bool) -> Arc<VersionTrack<Config>> { |
There was a problem hiding this comment.
all these configuration except use_delete_range parameter are hardcoded. So what's the point of creating a config instead of hardcode in the RegionRunner ?
There was a problem hiding this comment.
Also please add a comment to clarify what's the consumer of this Config. It may be easily confused as the config used by raftstore itself.
…ngine-ext into merge-tikv-engine-trait
|
/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. DetailsInstructions 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. DetailsCommit hash: 14b003a |
ref tikv#12849 Support new engine trait can_apply_snapshot Signed-off-by: CalvinNeo <calvinneo1995@gmail.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