Skip to content

Commit d7aea69

Browse files
cbi42facebook-github-bot
authored andcommitted
Fix stress test DB verification methods (#13409)
Summary: update VerifyDB() to respect user specified flags when choosing verification method. Pull Request resolved: #13409 Test Plan: existing CI. Reviewed By: hx235 Differential Revision: D69885644 Pulled By: cbi42 fbshipit-source-id: bbaa931cece3525f00d775639ec7b63ff0101d94
1 parent 3c2c268 commit d7aea69

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

db_stress_tool/db_stress_gflags.cc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -831,13 +831,15 @@ DEFINE_uint64(snapshot_hold_ops, 0,
831831
DEFINE_bool(long_running_snapshots, false,
832832
"If set, hold on some some snapshots for much longer time.");
833833

834+
// The following three options affect both regular read operations during the
835+
// test and initial/final database verification through VerifyDB.
834836
DEFINE_bool(use_multiget, false,
835-
"If set, use the batched MultiGet API for reads");
837+
"If set, use the batched MultiGet API for reads.");
836838

837-
DEFINE_bool(use_get_entity, false, "If set, use the GetEntity API for reads");
839+
DEFINE_bool(use_get_entity, false, "If set, use the GetEntity API for reads.");
838840

839841
DEFINE_bool(use_multi_get_entity, false,
840-
"If set, use the MultiGetEntity API for reads");
842+
"If set, use the MultiGetEntity API for reads.");
841843

842844
DEFINE_int32(test_ingest_standalone_range_deletion_one_in, 0,
843845
"If non-zero, file ingestion flow will test standalone range "

db_stress_tool/no_batched_ops_stress.cc

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,21 @@ class NonBatchedOpsStressTest : public StressTest {
7272
constexpr int num_methods =
7373
static_cast<int>(VerificationMethod::kNumberOfMethods);
7474

75-
const VerificationMethod method =
75+
VerificationMethod method =
7676
static_cast<VerificationMethod>(thread->rand.Uniform(
7777
(FLAGS_user_timestamp_size > 0) ? num_methods - 1 : num_methods));
7878

79+
if (method == VerificationMethod::kGetEntity && !FLAGS_use_get_entity) {
80+
method = VerificationMethod::kGet;
81+
}
82+
if (method == VerificationMethod::kMultiGetEntity &&
83+
!FLAGS_use_multi_get_entity) {
84+
method = VerificationMethod::kMultiGet;
85+
}
86+
if (method == VerificationMethod::kMultiGet && !FLAGS_use_multiget) {
87+
method = VerificationMethod::kGet;
88+
}
89+
7990
if (method == VerificationMethod::kIterator) {
8091
std::unique_ptr<ManagedSnapshot> snapshot = nullptr;
8192
if (options.auto_refresh_iterator_with_snapshot) {

0 commit comments

Comments
 (0)