Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
karencfv committed Nov 7, 2023
1 parent 17915d6 commit 9452105
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions dev-tools/omicron-dev/src/bin/omicron-dev.rs
Original file line number Diff line number Diff line change
Expand Up @@ -338,12 +338,11 @@ async fn start_replicated_cluster() -> Result<(), anyhow::Error> {
let mut signal_stream = signals.fuse();

// Start the database server and keeper processes
let cur_dir = std::env::current_dir().unwrap();
let manifest_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
let replica_config =
cur_dir.as_path().join("oximeter/db/src/configs/replica_config.xml");
let cur_dir = std::env::current_dir().unwrap();
manifest_dir.as_path().join("../../oximeter/db/src/configs/replica_config.xml");
let keeper_config =
cur_dir.as_path().join("oximeter/db/src/configs/keeper_config.xml");
manifest_dir.as_path().join("../../oximeter/db/src/configs/keeper_config.xml");

let mut cluster =
dev::clickhouse::ClickHouseCluster::new(replica_config, keeper_config)
Expand All @@ -356,7 +355,8 @@ async fn start_replicated_cluster() -> Result<(), anyhow::Error> {
);
let pid_error_msg = "Failed to get process PID, it may not have started";
println!(
"omicron-dev: ClickHouse cluster is running with PIDs: {}, {}, {}, {}, {}",
"omicron-dev: ClickHouse cluster is running with: server PIDs = [{}, {}] \
and keeper PIDs = [{}, {}, {}]",
cluster.replica_1
.pid()
.expect(pid_error_msg),
Expand Down
8 changes: 4 additions & 4 deletions test-utils/src/dev/clickhouse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -340,12 +340,12 @@ impl ClickHouseCluster {
// Start all Keeper coordinator nodes
let keeper_amount = 3;
let mut keepers =
Self::new_keeper_set(keeper_amount, keeper_config.clone()).await?;
Self::new_keeper_set(keeper_amount, &keeper_config).await?;

// Start all replica nodes
let replica_amount = 2;
let mut replicas =
Self::new_replica_set(replica_amount, replica_config.clone())
Self::new_replica_set(replica_amount, &replica_config)
.await?;

let r1 = replicas.swap_remove(0);
Expand All @@ -367,7 +367,7 @@ impl ClickHouseCluster {

pub async fn new_keeper_set(
keeper_amount: u16,
config_path: PathBuf,
config_path: &PathBuf,
) -> Result<Vec<ClickHouseInstance>, anyhow::Error> {
let mut keepers = vec![];

Expand All @@ -392,7 +392,7 @@ impl ClickHouseCluster {

pub async fn new_replica_set(
replica_amount: u16,
config_path: PathBuf,
config_path: &PathBuf,
) -> Result<Vec<ClickHouseInstance>, anyhow::Error> {
let mut replicas = vec![];

Expand Down

0 comments on commit 9452105

Please sign in to comment.