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
In-memory Engine: integrate hybrid engine with TiKV #16132
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. |
/run-test retry=7 |
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.
Do we really need engine trait to use it? Maybe regard it as a cache, and just add a field in apply and region snapshot?
Use trait can make fewer changes to raftstore. For example, we don't have extra code for caching write batch for in-memory engine, just put the detail in the implementation of |
PTAL thanks @Connor1996 |
0d97d36
to
51a5af2
Compare
@@ -209,9 +220,33 @@ pub fn run_tikv( | |||
|
|||
dispatch_api_version!(config.storage.api_version(), { | |||
if !config.raft_engine.enable { | |||
run_impl::<RocksEngine, API>(config, service_event_tx, service_event_rx) | |||
if config.region_cache_memory_limit == ReadableSize(0) { | |||
run_impl::<RocksEngine, RocksEngine, API>( |
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 suggest always using HybridEngine and check the region cache limit innerly
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.
After discussed offline, we think this is riskless once it is not enabled.
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.
But using HybridEngine
and when memory engine is not enabled, the code is actually a wrapper on RocksEngine without doing anything else
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.
It still needs to do some logics to check whether the memory engine can be used or something.
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.
LGTM
/merge |
@Connor1996: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests You only need to trigger
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: a1f6890
|
What is changed and how it works?
Issue Number: Ref #16141
What's Changed:
This PR refactors some parts mainly in component/server to replace RocksEngine by generic type implementing KvEngine.
So we can make
HybridEngine
as a specific type that implements KvEngine be used by TiKV server, RaftKv, raftstore and so on.Related changes
pingcap/docs
/pingcap/docs-cn
:Check List
Tests
Side effects
Release note