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.pull/24376/head
parent
635b22b5a9
commit
12974cf426
|
@ -141,13 +141,6 @@ pub async fn create_compactor2_server_type(
|
|||
compactor_config: Compactor2Config,
|
||||
) -> Arc<dyn ServerType> {
|
||||
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),
|
||||
|
|
Loading…
Reference in New Issue