diff --git a/dev-tools/clickhouse-cluster-dev/src/main.rs b/dev-tools/clickhouse-cluster-dev/src/main.rs index 2f85c53ab6..1b78144e4c 100644 --- a/dev-tools/clickhouse-cluster-dev/src/main.rs +++ b/dev-tools/clickhouse-cluster-dev/src/main.rs @@ -22,6 +22,16 @@ use std::time::Duration; async fn main() -> Result<()> { let request_timeout = Duration::from_secs(15); let (logctx, path) = default_clickhouse_log_ctx_and_path(); + + if path.exists() { + let deployment = + default_clickhouse_cluster_test_deployment(path.clone()); + slog::info!(logctx.log, "Stopping test clickhouse nodes"); + deployment.teardown()?; + slog::info!(logctx.log, "Removing previous temporary test directory"); + std::fs::remove_dir_all(&path)?; + } + std::fs::create_dir(&path)?; slog::info!(logctx.log, "Setting up a ClickHouse cluster");