From 12974cf426545591823f6ada8eaab5efbdf52c42 Mon Sep 17 00:00:00 2001 From: "Carol (Nichols || Goulding)" Date: Mon, 20 Mar 2023 16:41:31 -0400 Subject: [PATCH] fix: Fail if compactor shard args are invalid before contacting the catalog Fail fast if we know the shard config is invalid, without possibly failing while contacting the catalog. Also, fetching of the transition shard ID is going to go away soon anyway. --- ioxd_compactor2/src/lib.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/ioxd_compactor2/src/lib.rs b/ioxd_compactor2/src/lib.rs index 7c1ac4098a..bb67aa2715 100644 --- a/ioxd_compactor2/src/lib.rs +++ b/ioxd_compactor2/src/lib.rs @@ -141,13 +141,6 @@ pub async fn create_compactor2_server_type( compactor_config: Compactor2Config, ) -> Arc { let backoff_config = BackoffConfig::default(); - let shard_id = Config::fetch_shard_id( - Arc::clone(&catalog), - backoff_config.clone(), - TOPIC.to_string(), - TRANSITION_SHARD_INDEX, - ) - .await; assert!( compactor_config.shard_id.is_some() == compactor_config.shard_count.is_some(), @@ -172,6 +165,13 @@ pub async fn create_compactor2_server_type( ), }; + let shard_id = Config::fetch_shard_id( + Arc::clone(&catalog), + backoff_config.clone(), + TOPIC.to_string(), + TRANSITION_SHARD_INDEX, + ) + .await; let compactor = Compactor2::start(Config { shard_id, metric_registry: Arc::clone(&metric_registry),