Skip to content

Commit

Permalink
Fix stress test DB verification methods (#13409)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
cbi42 authored and facebook-github-bot committed Feb 21, 2025
1 parent 3c2c268 commit d7aea69
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
8 changes: 5 additions & 3 deletions db_stress_tool/db_stress_gflags.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 "
Expand Down
13 changes: 12 additions & 1 deletion db_stress_tool/no_batched_ops_stress.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit d7aea69

Please sign in to comment.