rocksdb/db/db_impl
Manuel Ung eae832740b WriteUnPrepared: improve read your own write functionality (#5573)
Summary:
There are a number of fixes in this PR (with most bugs found via the added stress tests):
1. Re-enable reseek optimization. This was initially disabled to avoid infinite loops in https://github.com/facebook/rocksdb/pull/3955 but this can be resolved by remembering not to reseek after a reseek has already been done. This problem only affects forward iteration in `DBIter::FindNextUserEntryInternal`, as we already disable reseeking in `DBIter::FindValueForCurrentKeyUsingSeek`.
2. Verify that ReadOption.snapshot can be safely used for iterator creation. Some snapshots would not give correct results because snaphsot validation would not be enforced, breaking some assumptions in Prev() iteration.
3. In the non-snapshot Get() case, reads done at `LastPublishedSequence` may not be enough, because unprepared sequence numbers are not published. Use `std::max(published_seq, max_visible_seq)` to do lookups instead.
4. Add stress test to test reading own writes.
5. Minor bug in the allow_concurrent_memtable_write case where we forgot to pass in batch_per_txn_.
6. Minor performance optimization in `CalcMaxUnpreparedSequenceNumber` by assigning by reference instead of value.
7. Add some more comments everywhere.
Pull Request resolved: https://github.com/facebook/rocksdb/pull/5573

Differential Revision: D16276089

Pulled By: lth

fbshipit-source-id: 18029c944eb427a90a87dee76ac1b23f37ec1ccb
2019-07-23 08:08:19 -07:00
..
db_impl_compaction_flush.cc Ref and unref cfd before and after calling WaitForFlushMemTables (#5513) 2019-07-01 14:12:02 -07:00
db_impl_debug.cc Ref and unref cfd before and after calling WaitForFlushMemTables (#5513) 2019-07-01 14:12:02 -07:00
db_impl_experimental.cc simplify include directive involving inttypes (#5402) 2019-06-06 13:56:07 -07:00
db_impl_files.cc Fix bugs in WAL trash file handling (#5520) 2019-07-06 21:07:32 -07:00
db_impl_open.cc Added log_readahead_size option to control prefetching for Log::Reader (#5592) 2019-07-19 12:00:19 -07:00
db_impl_readonly.cc Make format 2019-05-31 15:24:43 -07:00
db_impl_readonly.h Export Import sst files (#5495) 2019-07-17 12:27:14 -07:00
db_impl_secondary.cc Added log_readahead_size option to control prefetching for Log::Reader (#5592) 2019-07-19 12:00:19 -07:00
db_impl_secondary.h Override check consistency for DBImplSecondary (#5469) 2019-06-17 15:39:55 -07:00
db_impl_write.cc WriteUnPrepared: improve read your own write functionality (#5573) 2019-07-23 08:08:19 -07:00
db_impl.cc WriteUnPrepared: improve read your own write functionality (#5573) 2019-07-23 08:08:19 -07:00
db_impl.h Export Import sst files (#5495) 2019-07-17 12:27:14 -07:00
db_secondary_test.cc Fix a bug caused by secondary not skipping the beginning of new MANIFEST (#5472) 2019-06-18 11:21:37 -07:00