Closed
Conversation
Collaborator
|
@sagar this looks very interesting to me, could you comment on how you see this being used? |
|
Buddy I wish I could but don’t have any context :)
On Sat, 2 Feb 2019 at 5:01 PM, Adam Retter ***@***.***> wrote:
@sagar <https://github.com/sagar> this looks very interesting to me,
could you comment on how you see this being used?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#4942 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABI7d_f304O6mRJ694-4YmfyMa1o_7m2ks5vJXcugaJpZM4afeV1>
.
--
Sagar
|
Collaborator
|
@sagar so would this allow users to implement MVCC aware structures on top of RocksDB? For example if I wanted to cache some key/value pairs in-memory, I would need to know their version (or timestamp) so that my transaction is reading the correct version. |
This was referenced Mar 18, 2019
Contributor
Author
|
This PR was a prototype to show how user-provided timestamps feature can be implemented in RocksDB. |
facebook-github-bot
pushed a commit
that referenced
this pull request
Jun 6, 2019
Summary: It's useful to be able to (optionally) associate key-value pairs with user-provided timestamps. This PR is an early effort towards this goal and continues the work of #4942. A suite of new unit tests exist in DBBasicTestWithTimestampWithParam. Support for timestamp requires the user to provide timestamp as a slice in `ReadOptions` and `WriteOptions`. All timestamps of the same database must share the same length, format, etc. The format of the timestamp is the same throughout the same database, and the user is responsible for providing a comparator function (Comparator) to order the <key, timestamp> tuples. Once created, the format and length of the timestamp cannot change (at least for now). Test plan (on devserver): ``` $COMPILE_WITH_ASAN=1 make -j32 all $./db_basic_test --gtest_filter=Timestamp/DBBasicTestWithTimestampWithParam.PutAndGet/* $make check ``` All tests must pass. We also run the following db_bench tests to verify whether there is regression on Get/Put while timestamp is not enabled. ``` $TEST_TMPDIR=/dev/shm ./db_bench -benchmarks=fillseq,readrandom -num=1000000 $TEST_TMPDIR=/dev/shm ./db_bench -benchmarks=fillrandom -num=1000000 ``` Repeat for 6 times for both versions. Results are as follows: ``` | | readrandom | fillrandom | | master | 16.77 MB/s | 47.05 MB/s | | PR5079 | 16.44 MB/s | 47.03 MB/s | ``` Pull Request resolved: #5079 Differential Revision: D15132946 Pulled By: riversand963 fbshipit-source-id: 833a0d657eac21182f0f206c910a6438154c742c
vagogte
pushed a commit
to vagogte/rocksdb
that referenced
this pull request
Jun 18, 2019
Summary: It's useful to be able to (optionally) associate key-value pairs with user-provided timestamps. This PR is an early effort towards this goal and continues the work of facebook#4942. A suite of new unit tests exist in DBBasicTestWithTimestampWithParam. Support for timestamp requires the user to provide timestamp as a slice in `ReadOptions` and `WriteOptions`. All timestamps of the same database must share the same length, format, etc. The format of the timestamp is the same throughout the same database, and the user is responsible for providing a comparator function (Comparator) to order the <key, timestamp> tuples. Once created, the format and length of the timestamp cannot change (at least for now). Test plan (on devserver): ``` $COMPILE_WITH_ASAN=1 make -j32 all $./db_basic_test --gtest_filter=Timestamp/DBBasicTestWithTimestampWithParam.PutAndGet/* $make check ``` All tests must pass. We also run the following db_bench tests to verify whether there is regression on Get/Put while timestamp is not enabled. ``` $TEST_TMPDIR=/dev/shm ./db_bench -benchmarks=fillseq,readrandom -num=1000000 $TEST_TMPDIR=/dev/shm ./db_bench -benchmarks=fillrandom -num=1000000 ``` Repeat for 6 times for both versions. Results are as follows: ``` | | readrandom | fillrandom | | master | 16.77 MB/s | 47.05 MB/s | | PR5079 | 16.44 MB/s | 47.03 MB/s | ``` Pull Request resolved: facebook#5079 Differential Revision: D15132946 Pulled By: riversand963 fbshipit-source-id: 833a0d657eac21182f0f206c910a6438154c742c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A basic implementation to support user specified timestamps in RocksDB.
This allows to fetch older versions of the keys from RocksDB. RocksDB already provides MVCC support via snapshots and internal sequence numbers, but allowing RocksDB users to plugin their own timestamps is going one step further to allow users on top of RocksDB to build their own MVCC-aware services.
See the tests added in db_basic_test.cc :
DBBasicTest.Timestamp1andDBBasicTest.Timestamp2, but here's a simplified version:Sending this out so that we can start a discussion on the API. This is not ready for committing, yet.
In the current implementation:
timestampis added toWriteOptionsandReadOptions.sequence numberat the end of the internal key.Still need to think about / implement:
ValueType?