Refine db_stress params for atomic flush (#4781)

Summary:
Separate flag for enabling option from flag for enabling dedicated atomic stress test. I have found setting the former without setting the latter can detect different problems.
Pull Request resolved: https://github.com/facebook/rocksdb/pull/4781

Differential Revision: D13463211

Pulled By: ajkr

fbshipit-source-id: 054f777885b2dc7d5ea99faafa21d6537eee45fd
main
Andrew Kryczka 6 years ago committed by Facebook Github Bot
parent 349542332a
commit 8d2b74d287
  1. 2
      tools/db_crashtest.py
  2. 12
      tools/db_stress.cc

@ -126,9 +126,9 @@ blackbox_simple_default_params = {
whitebox_simple_default_params = {} whitebox_simple_default_params = {}
atomic_flush_params = { atomic_flush_params = {
"atomic_flush": 1,
"disable_wal": 1, "disable_wal": 1,
"reopen": 0, "reopen": 0,
"test_atomic_flush": 1,
# use small value for write_buffer_size so that RocksDB triggers flush # use small value for write_buffer_size so that RocksDB triggers flush
# more frequently # more frequently
"write_buffer_size": 1024 * 1024, "write_buffer_size": 1024 * 1024,

@ -133,7 +133,12 @@ DEFINE_bool(test_batches_snapshots, false,
"\t(b) No long validation at the end (more speed up)\n" "\t(b) No long validation at the end (more speed up)\n"
"\t(c) Test snapshot and atomicity of batch writes"); "\t(c) Test snapshot and atomicity of batch writes");
DEFINE_bool(atomic_flush, false, "If true, the test enables atomic flush\n"); DEFINE_bool(atomic_flush, false,
"If set, enables atomic flush in the options.\n");
DEFINE_bool(test_atomic_flush, false,
"If set, runs the stress test dedicated to verifying atomic flush "
"functionality. Setting this implies `atomic_flush=true`.\n");
DEFINE_int32(threads, 32, "Number of concurrent threads to run."); DEFINE_int32(threads, 32, "Number of concurrent threads to run.");
@ -3782,6 +3787,9 @@ int main(int argc, char** argv) {
"Error: clear_column_family_one_in must be 0 when using backup\n"); "Error: clear_column_family_one_in must be 0 when using backup\n");
exit(1); exit(1);
} }
if (FLAGS_test_atomic_flush) {
FLAGS_atomic_flush = true;
}
// Choose a location for the test database if none given with --db=<path> // Choose a location for the test database if none given with --db=<path>
if (FLAGS_db.empty()) { if (FLAGS_db.empty()) {
@ -3795,7 +3803,7 @@ int main(int argc, char** argv) {
rocksdb_kill_prefix_blacklist = SplitString(FLAGS_kill_prefix_blacklist); rocksdb_kill_prefix_blacklist = SplitString(FLAGS_kill_prefix_blacklist);
std::unique_ptr<rocksdb::StressTest> stress; std::unique_ptr<rocksdb::StressTest> stress;
if (FLAGS_atomic_flush) { if (FLAGS_test_atomic_flush) {
stress.reset(new rocksdb::AtomicFlushStressTest()); stress.reset(new rocksdb::AtomicFlushStressTest());
} else if (FLAGS_test_batches_snapshots) { } else if (FLAGS_test_batches_snapshots) {
stress.reset(new rocksdb::BatchedOpsStressTest()); stress.reset(new rocksdb::BatchedOpsStressTest());

Loading…
Cancel
Save