Skip to content

Commit 2e6d65a

Browse files
committed
Use followers_base as name in OpenAsFollower
1 parent 12e51b0 commit 2e6d65a

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

db_stress_tool/db_stress_test_base.cc

+8-3
Original file line numberDiff line numberDiff line change
@@ -3713,10 +3713,15 @@ void StressTest::Open(SharedState* shared, bool reopen) {
37133713
Options tmp_opts;
37143714
tmp_opts.max_open_files = -1;
37153715
tmp_opts.env = db_stress_env;
3716-
// Need to use the leader path not the follower path
3716+
// Equivalent to "name" argument in OpenAsSecondary
37173717
const std::string& leader_path = FLAGS_db;
3718-
s = DB::OpenAsFollower(tmp_opts, FLAGS_db /* name */, leader_path,
3719-
cf_descriptors, &follower_cfhs_, &follower_db_);
3718+
// Equivalent to "secondary_path" in OpenAsSecondary
3719+
const std::string& name = FLAGS_followers_base;
3720+
s = DB::OpenAsFollower(tmp_opts, name, leader_path, cf_descriptors,
3721+
&follower_cfhs_, &follower_db_);
3722+
if (!s.ok()) {
3723+
fprintf(stderr, "Error opening follower: %s\n", s.ToString().c_str());
3724+
}
37203725
assert(s.ok());
37213726
assert(follower_cfhs_.size() ==
37223727
static_cast<size_t>(FLAGS_column_families));

tools/db_crashtest.py

+1
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,7 @@ def is_direct_io_supported(dbname):
486486
"level_compaction_dynamic_level_bytes": lambda: random.randint(0, 1),
487487
"paranoid_file_checks": lambda: random.choice([0, 1, 1, 1]),
488488
"test_secondary": lambda: random.choice([0, 1]),
489+
"test_follower": lambda: random.choice([0, 1]),
489490
}
490491

491492
blackbox_simple_default_params = {

0 commit comments

Comments
 (0)