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
*: make gc not write db directly #13982
Conversation
We rely on non-concurrent memtable write for dynamic regions to achieve best performance. This PR makes sure writes of compaction filter be redirected to apply thread when dynamic regions is enabled. The solution may miss data if TiKV crashes before writes are flushed to disk. Note even for v1, it's also possible to leave garbage if writes to rocksdb fail. We need to scan default CFs and check for orphan versions. Signed-off-by: Jay Lee <BusyJayLee@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. Reviewer can indicate their review by submitting an approval review. |
@@ -135,8 +136,6 @@ impl Drop for RawCompactionFilter { | |||
fn drop(&mut self) { | |||
self.raw_gc_mvcc_deletions(); | |||
|
|||
self.engine.sync_wal().unwrap(); |
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.
sync_wal is not needed in v2. But what about v1? I suppose src/server/gc_worker/rawkv_compaction_filter.rs is for v1 as well.
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.
rawkv doesn't write to kv db directly, it was added by accident.
modifies = vec![]; | ||
} | ||
} | ||
if let Err(e) = self.engine.modify_on_kv_engine(region_modifies) { |
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.
How to ensure when the apply runs the unsafe delete, it's still the same tablet. I think we need to add the tablet suffix in the region_modifies
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.
We don't. The deleted keys are the keys that's stale. Once they are stale, they will always be. So always delete them in the latest tablet is correct.
/merge |
@BusyJay: 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: b673f5a
|
@BusyJay: Your PR was out of date, I have automatically updated it for you. 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. 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. |
What is changed and how it works?
Issue Number: Ref #12842
What's Changed:
Check List
Tests
Release note