|
|
|
@ -517,9 +517,18 @@ void StressTest::PreloadDbAndReopenAsReadOnly(int64_t number_of_keys, |
|
|
|
|
|
|
|
|
|
shared->Put(cf_idx, k, value_base, true /* pending */); |
|
|
|
|
|
|
|
|
|
std::string ts; |
|
|
|
|
if (FLAGS_user_timestamp_size > 0) { |
|
|
|
|
ts = GetNowNanos(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (FLAGS_use_merge) { |
|
|
|
|
if (!FLAGS_use_txn) { |
|
|
|
|
s = db_->Merge(write_opts, cfh, key, v); |
|
|
|
|
if (FLAGS_user_timestamp_size > 0) { |
|
|
|
|
s = db_->Merge(write_opts, cfh, key, ts, v); |
|
|
|
|
} else { |
|
|
|
|
s = db_->Merge(write_opts, cfh, key, v); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
#ifndef ROCKSDB_LITE |
|
|
|
|
Transaction* txn; |
|
|
|
@ -538,7 +547,6 @@ void StressTest::PreloadDbAndReopenAsReadOnly(int64_t number_of_keys, |
|
|
|
|
} else { |
|
|
|
|
if (!FLAGS_use_txn) { |
|
|
|
|
if (FLAGS_user_timestamp_size > 0) { |
|
|
|
|
const std::string ts = GetNowNanos(); |
|
|
|
|
s = db_->Put(write_opts, cfh, key, ts, v); |
|
|
|
|
} else { |
|
|
|
|
s = db_->Put(write_opts, cfh, key, v); |
|
|
|
@ -2960,7 +2968,8 @@ void StressTest::MaybeUseOlderTimestampForRangeScan(ThreadState* thread, |
|
|
|
|
ts_slice = ts_str; |
|
|
|
|
read_opts.timestamp = &ts_slice; |
|
|
|
|
|
|
|
|
|
if (!thread->rand.OneInOpt(3)) { |
|
|
|
|
// TODO (yanqin): support Merge with iter_start_ts
|
|
|
|
|
if (!thread->rand.OneInOpt(3) || FLAGS_use_merge || FLAGS_use_full_merge_v1) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -2981,10 +2990,6 @@ void CheckAndSetOptionsForUserTimestamp(Options& options) { |
|
|
|
|
static_cast<int>(cmp->timestamp_size())); |
|
|
|
|
exit(1); |
|
|
|
|
} |
|
|
|
|
if (FLAGS_use_merge || FLAGS_use_full_merge_v1) { |
|
|
|
|
fprintf(stderr, "Merge does not support timestamp yet.\n"); |
|
|
|
|
exit(1); |
|
|
|
|
} |
|
|
|
|
if (FLAGS_use_txn) { |
|
|
|
|
fprintf(stderr, "TransactionDB does not support timestamp yet.\n"); |
|
|
|
|
exit(1); |
|
|
|
|