mirror of
https://github.com/facebook/rocksdb.git
synced 2024-11-25 22:44:05 +00:00
db_stress to cover total order seek (#6039)
Summary: Right now, in db_stress, as long as prefix extractor is defined, TestIterator always uses. There is value of cover total_order_seek = true when prefix extractor is define. Add a small chance that this flag is turned on. Pull Request resolved: https://github.com/facebook/rocksdb/pull/6039 Test Plan: Run the test for a while. Differential Revision: D18539689 fbshipit-source-id: 568790dd7789c9986b83764b870df0423a122d99
This commit is contained in:
parent
5b9233bfe8
commit
a150604e10
|
@ -2426,6 +2426,11 @@ class StressTest {
|
|||
ReadOptions readoptionscopy = read_opts;
|
||||
readoptionscopy.snapshot = snapshot;
|
||||
|
||||
if (thread->rand.OneIn(16)) {
|
||||
// When prefix extractor is used, it's useful to cover total order seek.
|
||||
readoptionscopy.total_order_seek = true;
|
||||
}
|
||||
|
||||
std::string upper_bound_str;
|
||||
Slice upper_bound;
|
||||
if (thread->rand.OneIn(16)) {
|
||||
|
@ -2585,7 +2590,8 @@ class StressTest {
|
|||
// Iterator is not valid. It can be legimate if it has already been
|
||||
// out of upper or lower bound, or filtered out by prefix iterator.
|
||||
const Slice& total_order_key = cmp_iter->key();
|
||||
const SliceTransform* pe = options_.prefix_extractor.get();
|
||||
const SliceTransform* pe =
|
||||
ro.total_order_seek ? nullptr : options_.prefix_extractor.get();
|
||||
const Comparator* cmp = options_.comparator;
|
||||
|
||||
if (pe != nullptr) {
|
||||
|
|
Loading…
Reference in a new issue