-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
Provide support for subcompactions with user-defined timestamps #10344
Provide support for subcompactions with user-defined timestamps #10344
Conversation
3b291a6
to
75c7d69
Compare
082b3b6
to
f9c357a
Compare
@akankshamahajan15 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
f9c357a
to
594cb27
Compare
@akankshamahajan15 has updated the pull request. You must reimport the pull request before landing. |
@akankshamahajan15 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
594cb27
to
598a96f
Compare
@akankshamahajan15 has updated the pull request. You must reimport the pull request before landing. |
@akankshamahajan15 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
598a96f
to
56304f4
Compare
@akankshamahajan15 has updated the pull request. You must reimport the pull request before landing. |
56304f4
to
bbe903c
Compare
@akankshamahajan15 has updated the pull request. You must reimport the pull request before landing. |
bbe903c
to
67603af
Compare
@akankshamahajan15 has updated the pull request. You must reimport the pull request before landing. |
@akankshamahajan15 has imported this pull request. If you are a Meta 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.
Thanks @akankshamahajan15 for the PR! A few minor comments.
It would be good if we can add a comment to ReadOptions::iterate_upper_bound
and ReadOptions::iterate_lower_bound
saying that they do not include user-defined timestamp.
67603af
to
be51fdd
Compare
@akankshamahajan15 has updated the pull request. You must reimport the pull request before landing. |
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.
A few more minor comments. Otherwise, LGTM.
I don't think this PR has a risk of perf regression, but you can use db_bench
waitforcompact
benchmark and verify.
For db_bench do I need to pass any other argument
It doesn't print the time taken. |
Summary: The subcompaction logic currently picks file boundaries as subcompaction boundaries. This is not compatible with user-defined timestamps, as ReadOptions.iterate_lower_bound and ReadOptions.iterate_upper_bound contains timestamps. Test Plan: Added new unit test
be51fdd
to
59086c7
Compare
@akankshamahajan15 has updated the pull request. You must reimport the pull request before landing. |
@akankshamahajan15 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
hmm, how about benchmark "compactall". TEST_TMPDIR=/dev/shm/ ./db_bench -disable_auto_compactions=1 -benchmarks=fillrandom -threads=32
TEST_TMPDIR=/dev/shm/ -disable_auto_compactions=1 -use_existing_db=1 -benchmarks=compactall -subcompactions=3
``
Benchmark compactall does not report elapsed time either, but you can either add some code or simply use linux `time` command? |
Summary: Test Plan: Reviewers: Subscribers: Tasks: Tags:
59086c7
to
c02d710
Compare
@akankshamahajan15 has updated the pull request. You must reimport the pull request before landing. |
@akankshamahajan15 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Db_bench:
With Changes:
|
Summary: The subcompaction logic currently picks file boundaries as subcompaction boundaries. This is not compatible with user-defined timestamps because of two issues.
Issue1: ReadOptions.iterate_lower_bound and ReadOptions.iterate_upper_bound contains timestamps which results in assertion failure as BlockBasedTableIterator expects bounds to be without timestamps. As result, because of wrong comparison end key is returned as user_key resulting in assertion failure.
Issue2: Since it might result in two keys that only differ by user timestamp getting processed by two different subcompactions (and thus two different CompactionIterator state machines), which in turn can cause data correction issues.
This PR provide support to reenable subcompactions with user-defined timestamps.
Test Plan: Added new unit test
Ran stress test
make crash_test_with_ts -j32