rocksdb/db/db_impl
Yanqin Jin 340ed4fac7 Add support for timestamp in Get/Put (#5079)
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: https://github.com/facebook/rocksdb/pull/5079

Differential Revision: D15132946

Pulled By: riversand963

fbshipit-source-id: 833a0d657eac21182f0f206c910a6438154c742c
2019-06-05 23:10:47 -07:00
..
db_impl_compaction_flush.cc Ignore shutdown error during compaction (#5400) 2019-06-03 22:40:43 -07:00
db_impl_debug.cc Organizing rocksdb/db directory 2019-05-31 11:57:01 -07:00
db_impl_experimental.cc Organizing rocksdb/db directory 2019-05-31 11:57:01 -07:00
db_impl_files.cc Organizing rocksdb/db directory 2019-05-31 11:57:01 -07:00
db_impl_open.cc Call ValidateOptions from SetOptions (#5368) 2019-06-03 19:49:57 -07:00
db_impl_readonly.cc Make format 2019-05-31 15:24:43 -07:00
db_impl_readonly.h Organizing rocksdb/db directory 2019-05-31 11:57:01 -07:00
db_impl_secondary.cc Move some logging related files to logging/ (#5387) 2019-05-31 17:23:59 -07:00
db_impl_secondary.h Organizing rocksdb/db directory 2019-05-31 11:57:01 -07:00
db_impl_write.cc Add support for timestamp in Get/Put (#5079) 2019-06-05 23:10:47 -07:00
db_impl.cc Add support for timestamp in Get/Put (#5079) 2019-06-05 23:10:47 -07:00
db_impl.h Ignore shutdown error during compaction (#5400) 2019-06-03 22:40:43 -07:00
db_secondary_test.cc Make RocksDB secondary instance respect atomic groups in version edits. (#5411) 2019-06-04 10:56:19 -07:00