mirror of
https://github.com/facebook/rocksdb.git
synced 2026-10-27 20:33:15 +03:00
Fix stress test DB verification methods (#13409)
Summary: update VerifyDB() to respect user specified flags when choosing verification method. Pull Request resolved: https://github.com/facebook/rocksdb/pull/13409 Test Plan: existing CI. Reviewed By: hx235 Differential Revision: D69885644 Pulled By: cbi42 fbshipit-source-id: bbaa931cece3525f00d775639ec7b63ff0101d94
This commit is contained in:
committed by
Facebook GitHub Bot
parent
3c2c2689b9
commit
d7aea6955c
@@ -831,13 +831,15 @@ DEFINE_uint64(snapshot_hold_ops, 0,
|
||||
DEFINE_bool(long_running_snapshots, false,
|
||||
"If set, hold on some some snapshots for much longer time.");
|
||||
|
||||
// The following three options affect both regular read operations during the
|
||||
// test and initial/final database verification through VerifyDB.
|
||||
DEFINE_bool(use_multiget, false,
|
||||
"If set, use the batched MultiGet API for reads");
|
||||
"If set, use the batched MultiGet API for reads.");
|
||||
|
||||
DEFINE_bool(use_get_entity, false, "If set, use the GetEntity API for reads");
|
||||
DEFINE_bool(use_get_entity, false, "If set, use the GetEntity API for reads.");
|
||||
|
||||
DEFINE_bool(use_multi_get_entity, false,
|
||||
"If set, use the MultiGetEntity API for reads");
|
||||
"If set, use the MultiGetEntity API for reads.");
|
||||
|
||||
DEFINE_int32(test_ingest_standalone_range_deletion_one_in, 0,
|
||||
"If non-zero, file ingestion flow will test standalone range "
|
||||
|
||||
@@ -72,10 +72,21 @@ class NonBatchedOpsStressTest : public StressTest {
|
||||
constexpr int num_methods =
|
||||
static_cast<int>(VerificationMethod::kNumberOfMethods);
|
||||
|
||||
const VerificationMethod method =
|
||||
VerificationMethod method =
|
||||
static_cast<VerificationMethod>(thread->rand.Uniform(
|
||||
(FLAGS_user_timestamp_size > 0) ? num_methods - 1 : num_methods));
|
||||
|
||||
if (method == VerificationMethod::kGetEntity && !FLAGS_use_get_entity) {
|
||||
method = VerificationMethod::kGet;
|
||||
}
|
||||
if (method == VerificationMethod::kMultiGetEntity &&
|
||||
!FLAGS_use_multi_get_entity) {
|
||||
method = VerificationMethod::kMultiGet;
|
||||
}
|
||||
if (method == VerificationMethod::kMultiGet && !FLAGS_use_multiget) {
|
||||
method = VerificationMethod::kGet;
|
||||
}
|
||||
|
||||
if (method == VerificationMethod::kIterator) {
|
||||
std::unique_ptr<ManagedSnapshot> snapshot = nullptr;
|
||||
if (options.auto_refresh_iterator_with_snapshot) {
|
||||
|
||||
Reference in New Issue
Block a user