-
Notifications
You must be signed in to change notification settings - Fork 57
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
fix compact_bundle to enqueue filter compaction for entire range #628
Conversation
✅ Deploy Preview for splinterdb canceled.
|
src/trunk.c
Outdated
@@ -5303,6 +5304,9 @@ trunk_compact_bundle(void *arg, void *scratch_buf) | |||
|
|||
deinit_saved_pivots_in_scratch(scratch); | |||
|
|||
rc = key_buffer_init_from_key(&scratch->req_original_start_key, spl->heap_id, key_buffer_key(&req->start_key)); |
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.
Since we may overwrite the start key of the compaction request, save it here.
src/trunk.c
Outdated
@@ -5445,8 +5450,10 @@ trunk_compact_bundle(void *arg, void *scratch_buf) | |||
key_string(trunk_data_config(spl), end_key), | |||
req->height, | |||
req->bundle_no); | |||
key_buffer_copy_key(&req->start_key, key_buffer_key(&scratch->req_original_start_key)); |
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.
Restore it here so that the filter compaction will cover the entire range of the original bundle compaction request,
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.
Looks good, but I think it would be better to change the code not to modify req->start_key
and instead use a live variable for the start key during compaction cleanup.
@@ -5445,8 +5453,11 @@ trunk_compact_bundle(void *arg, void *scratch_buf) | |||
key_string(trunk_data_config(spl), end_key), | |||
req->height, | |||
req->bundle_no); | |||
key_buffer_copy_key(&req->start_key, |
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.
There's a sort of smoke and mirrors thing happening here, where start_key
is the start key of each split-sibling node during the compaction cleanup, but then it gets reset as the filter start key here.
I think it would be better if the compaction cleanup start key was its own variable, preferably not attached to req
.
No description provided.