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

Disable subcompactions for user-defined timestamps #8393

Closed
wants to merge 3 commits into from

Conversation

ltamasi
Copy link
Contributor

@ltamasi ltamasi commented Jun 11, 2021

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: 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.

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.
@facebook-github-bot
Copy link
Contributor

@ltamasi has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Copy link
Contributor

@jay-zhuang jay-zhuang left a 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:

// 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.

@ltamasi
Copy link
Contributor Author

ltamasi commented Jun 12, 2021

I think it worth documenting that, maybe here:

// 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 HISTORY.md though.

@facebook-github-bot
Copy link
Contributor

@ltamasi has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

@ltamasi has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@ltamasi merged this pull request in 1462638.

@riversand963
Copy link
Contributor

Thanks @ltamasi for the fix. Could you open a task so that we can track it?

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.

None yet

4 participants