Skip to content
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

Merged
merged 2 commits into from
Aug 13, 2024

Conversation

rtjohnso
Copy link
Contributor

No description provided.

Copy link

netlify bot commented May 23, 2024

Deploy Preview for splinterdb canceled.

Name Link
🔨 Latest commit ab9958d
🔍 Latest deploy log https://app.netlify.com/sites/splinterdb/deploys/664ef6784ea6e90009a8b2c0

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));
Copy link
Contributor Author

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));
Copy link
Contributor Author

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,

Copy link
Contributor

@ajhconway ajhconway left a 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,
Copy link
Contributor

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.

@rtjohnso rtjohnso merged commit 08d3cdb into main Aug 13, 2024
13 checks passed
@rtjohnso rtjohnso deleted the robj/filter-fix branch August 13, 2024 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants