diff --git a/db_stress_tool/db_stress_test_base.cc b/db_stress_tool/db_stress_test_base.cc index 7743c907a2ac..510f541dc9a0 100644 --- a/db_stress_tool/db_stress_test_base.cc +++ b/db_stress_tool/db_stress_test_base.cc @@ -3709,10 +3709,15 @@ void StressTest::Open(SharedState* shared, bool reopen) { Options tmp_opts; tmp_opts.max_open_files = -1; tmp_opts.env = db_stress_env; - // Need to use the leader path not the follower path + // Equivalent to "name" argument in OpenAsSecondary const std::string& leader_path = FLAGS_db; - s = DB::OpenAsFollower(tmp_opts, FLAGS_db /* name */, leader_path, - cf_descriptors, &follower_cfhs_, &follower_db_); + // Equivalent to "secondary_path" in OpenAsSecondary + const std::string& name = FLAGS_followers_base; + s = DB::OpenAsFollower(tmp_opts, name, leader_path, cf_descriptors, + &follower_cfhs_, &follower_db_); + if (!s.ok()) { + fprintf(stderr, "Error opening follower: %s\n", s.ToString().c_str()); + } assert(s.ok()); assert(follower_cfhs_.size() == static_cast<size_t>(FLAGS_column_families)); diff --git a/tools/db_crashtest.py b/tools/db_crashtest.py index ef40dc302bc9..718a7db9fc0b 100644 --- a/tools/db_crashtest.py +++ b/tools/db_crashtest.py @@ -485,6 +485,7 @@ def is_direct_io_supported(dbname): "write_buffer_size": 32 * 1024 * 1024, "level_compaction_dynamic_level_bytes": lambda: random.randint(0, 1), "paranoid_file_checks": lambda: random.choice([0, 1, 1, 1]), + "test_follower": lambda: random.choice([0, 1]), } blackbox_simple_default_params = {