-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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 engine trait can_apply_snapshot #12924
Conversation
Signed-off-by: CalvinNeo <[email protected]>
Signed-off-by: CalvinNeo <[email protected]>
[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 <[email protected]>
Signed-off-by: CalvinNeo <[email protected]>
/run-all-tests |
2 similar comments
/run-all-tests |
/run-all-tests |
Signed-off-by: CalvinNeo <[email protected]>
Signed-off-by: CalvinNeo <[email protected]>
/run-all-tests |
/cc @BusyJay |
@@ -66,6 +66,10 @@ impl RocksEngine { | |||
self.shared_block_cache = enable; | |||
} | |||
|
|||
pub fn get_shared_block_cache(&self) -> bool { |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why need is_timeout
? How can it make any difference?
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then why bother calling can_apply_snapshot
again when timeout?
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.
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 <[email protected]>
Signed-off-by: CalvinNeo <[email protected]>
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Signed-off-by: CalvinNeo <[email protected]>
…ngine-ext into merge-tikv-engine-trait
Signed-off-by: CalvinNeo <[email protected]>
Signed-off-by: CalvinNeo <[email protected]>
Signed-off-by: CalvinNeo <[email protected]>
Signed-off-by: CalvinNeo <[email protected]>
/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: 14b003a
|
ref tikv#12849 Support new engine trait can_apply_snapshot Signed-off-by: CalvinNeo <[email protected]>
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