-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
Disable subcompactions for user-defined timestamps #8393
Conversation
Summary: The subcompaction boundary picking logic does not currently guarantee that all user keys that differ only by timestamp get processed by the same subcompaction. This can cause issues with the `CompactionIterator` state machine. Test Plan: Ran `make check` and the crash test script with timestamps enabled.
@ltamasi has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
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 think it worth documenting that, maybe here:
rocksdb/include/rocksdb/options.h
Lines 615 to 621 in 80a59a0
// This value represents the maximum number of threads that will | |
// concurrently perform a compaction job by breaking it into multiple, | |
// smaller ones that are run simultaneously. | |
// Default: 1 (i.e. no subcompactions) | |
// | |
// Dynamically changeable through SetDBOptions() API. | |
uint32_t max_subcompactions = 1; |
Or maybe we should just explicitly return unsupported if the user is setting subcompaction number > 1 and timestamp is set.
I consider this just a temporary measure since it is possible to support subcompactions for user-defined timestamps with some work. So I don't think we should update the API description; we should probably call this out in |
@ltamasi has updated the pull request. You must reimport the pull request before landing. |
@ltamasi has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
Thanks @ltamasi for the fix. Could you open a task so that we can track it? |
Summary:
The subcompaction boundary picking logic does not currently guarantee
that all user keys that differ only by timestamp get processed by the same
subcompaction. This can cause issues with the
CompactionIterator
statemachine: for instance, one subcompaction that processes a subset of such KVs
might drop a tombstone based on the KVs it sees, while in reality the
tombstone might not have been eligible to be optimized out.
(See also #6645, which adjusted the way compaction inputs are picked for the
same reason.)
Test Plan:
Ran
make check
and the crash test script with timestamps enabled.