Skip to content

Commit

Permalink
Use followers_base as name in OpenAsFollower
Browse files Browse the repository at this point in the history
  • Loading branch information
archang19 committed Jan 9, 2025
1 parent fb805e7 commit 4a5d56a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
11 changes: 8 additions & 3 deletions db_stress_tool/db_stress_test_base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
1 change: 1 addition & 0 deletions tools/db_crashtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down

0 comments on commit 4a5d56a

Please sign in to comment.