-
Notifications
You must be signed in to change notification settings - Fork 171
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
[PCP-21] Titan GC doesn’t affect online write #121
Conversation
Signed-off-by: tabokie <xy.tao@outlook.com>
Signed-off-by: tabokie <xy.tao@outlook.com>
A bug is spotted in current work: merge's correctness depends on retrieving up-to-date logical file state, meanwhile the file state transit depends on all new indexes being inserted so we can use |
Signed-off-by: tabokie <xy.tao@outlook.com>
Signed-off-by: tabokie <xy.tao@outlook.com>
ready for review now @yiwu-arbug @Connor1996. benchmark coming soon. |
Signed-off-by: tabokie <xy.tao@outlook.com>
Signed-off-by: tabokie <xy.tao@outlook.com>
@tabokie Awesome! Let's see how benchmark is doing. |
Signed-off-by: tabokie <xy.tao@outlook.com>
Signed-off-by: tabokie <xy.tao@outlook.com>
Signed-off-by: tabokie <xy.tao@outlook.com>
fcc5274
to
c985bc4
Compare
@yiwu-arbug @Connor1996 Here are some test results, Write performance brought by new gc is impressive, while gc-with-merge is more feasible with read regression below 10 percent. dbbench ( go-ycsb ( |
7203694
to
72ae1a8
Compare
Codecov Report
@@ Coverage Diff @@
## master #121 +/- ##
==========================================
- Coverage 86.02% 85.46% -0.57%
==========================================
Files 45 45
Lines 3528 3419 -109
==========================================
- Hits 3035 2922 -113
- Misses 493 497 +4 |
Signed-off-by: tabokie <xy.tao@outlook.com>
Signed-off-by: tabokie <xy.tao@outlook.com>
b711f6a
to
de28ea4
Compare
Signed-off-by: tabokie <xy.tao@outlook.com>
Signed-off-by: tabokie <xy.tao@outlook.com>
Signed-off-by: tabokie <xy.tao@outlook.com>
Signed-off-by: tabokie <xy.tao@outlook.com>
@tabokie As we are approaching the end of PCP, we need to merge this PR this week. To speed it up, let's do the following:
This is great work overall! We can keep working on remaining work after PCP. We definitely want it to included in tikv 4.0 release. |
@yiwu-arbug Some Q&A first:
|
Signed-off-by: tabokie <xy.tao@outlook.com>
Signed-off-by: tabokie <xy.tao@outlook.com>
36a7b47
to
89165f5
Compare
Almost good now, PTAL @yiwu-arbug @Connor1996 |
I may be missing something, but I still think merge operator don't need to know LSN of values. Just like the write callback for gc-with-put doesn't need to know LSN of keys. I think we can simply use the following logic in merge op (pseudo-code):
|
Signed-off-by: tabokie <xy.tao@outlook.com>
0fc65d0
to
d8c3691
Compare
Signed-off-by: tabokie <xy.tao@outlook.com>
Signed-off-by: tabokie <xy.tao@outlook.com>
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.
rest LGTM
Signed-off-by: tabokie <xy.tao@outlook.com>
69899e4
to
26536a6
Compare
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, let's merge rocksdb first
LGTM. Leave to @Connor1996 for merge. |
@Connor1996 Can we merge it now? |
Signed-off-by: tabokie <xy.tao@outlook.com>
Signed-off-by: tabokie <xy.tao@outlook.com>
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
* Green Blob GC by merge operator Signed-off-by: tabokie <xy.tao@outlook.com>
This reverts commit 4dc4ba8.
This reverts commit 4dc4ba8. Signed-off-by: tabokie <xy.tao@outlook.com>
* Revert "[PCP-21] Titan GC doesn’t affect online write (#121)" This reverts commit 4dc4ba8. Signed-off-by: tabokie <xy.tao@outlook.com> * format and build Signed-off-by: tabokie <xy.tao@outlook.com> * restore some modifications to tests Signed-off-by: tabokie <xy.tao@outlook.com> * Trigger rebuild Signed-off-by: tabokie <xy.tao@outlook.com>
* work with 6.29.tikv Signed-off-by: tabokie <xy.tao@outlook.com> * fix some more Signed-off-by: tabokie <xy.tao@outlook.com> * make it build Signed-off-by: tabokie <xy.tao@outlook.com> * format Signed-off-by: tabokie <xy.tao@outlook.com> * fix snappy include dir Signed-off-by: tabokie <xy.tao@outlook.com> * fix more includes Signed-off-by: tabokie <xy.tao@outlook.com> * fix some conflicts with blobdb Signed-off-by: tabokie <xy.tao@outlook.com> * properly initialize compaction filter when creating cf Signed-off-by: tabokie <xy.tao@outlook.com> * clean up comments Signed-off-by: tabokie <xy.tao@outlook.com> * Revert "[PCP-21] Titan GC doesn’t affect online write (#121)" This reverts commit 4dc4ba8. Signed-off-by: tabokie <xy.tao@outlook.com> * format and build Signed-off-by: tabokie <xy.tao@outlook.com> * restore some modifications to tests Signed-off-by: tabokie <xy.tao@outlook.com> * fix double free and test issues Signed-off-by: tabokie <xy.tao@outlook.com> * fix test case LevelMerge Signed-off-by: tabokie <xy.tao@outlook.com> * fix testharness link Signed-off-by: tabokie <xy.tao@outlook.com> * fix release build Signed-off-by: tabokie <xy.tao@outlook.com> * fix test build Signed-off-by: tabokie <xy.tao@outlook.com> * fix asan errors Signed-off-by: tabokie <xy.tao@outlook.com> * remove stale code Signed-off-by: tabokie <xy.tao@outlook.com> * re-inline db_iter implementation Signed-off-by: tabokie <xy.tao@outlook.com> * re-order includes Signed-off-by: tabokie <xy.tao@outlook.com> * rearrange CMakeLists.txt Signed-off-by: tabokie <xy.tao@outlook.com> * address comment and fix tools build Signed-off-by: tabokie <xy.tao@outlook.com> * fix unstable test DeleteFilesInRangeDuringGC Signed-off-by: tabokie <xy.tao@outlook.com> * update readme Signed-off-by: tabokie <xy.tao@outlook.com> * group some more includes Signed-off-by: tabokie <xy.tao@outlook.com> * update README Signed-off-by: tabokie <xy.tao@outlook.com>
Green Blob GC by merge operator
tikv/tikv#5739
Merge Semantics: keep freshest version
A. key + merged index: source-index must be older than key, apply key
B. index + merged index: if index is stale (GCed), apply merged-index or simply delete key; else apply index
implementation:
source-file-number
info can be stored in merge-blob-indexC. merged index + merged index (merge against delete): deletes key (use deletion marker instead)
D. merged index + merged index (partial merge): by LSN version of original put.
implementation:
embed LSN in blob key, when conflict read blob for latest index. (partial merge must read blob)GC workflow:
Three approaches to merge new index into rocksdb, requires further benchmarking:
Merge
opRocksdb Change:
tikv/rocksdb#147
support kTypeBlobIndex in merge operation(to support user-specified merge on top of gc-merge, extend merge value to include operand type)merge operator deletes key