diff --git a/crates/fluvio-sc/src/stores/topic/store.rs b/crates/fluvio-sc/src/stores/topic/store.rs index 30ef23c177e..9c60f9ea49f 100644 --- a/crates/fluvio-sc/src/stores/topic/store.rs +++ b/crates/fluvio-sc/src/stores/topic/store.rs @@ -44,16 +44,14 @@ where let replica_key = ReplicaKey::new(self.key(), *idx); let partition_spec = PartitionSpec::from_replicas(replicas.clone(), &self.spec, mirror); - let store = partition_store.read().await; - let partition = store.get(&replica_key); - if let Some(p) = partition { - partitions.push(p.inner().clone()); - } else { + if !partition_store.contains_key(&replica_key).await { debug!(?replica_key, ?partition_spec, "creating new partition"); partitions.push( MetadataStoreObject::with_spec(replica_key, partition_spec) .with_context(self.ctx.create_child()), ) + } else { + debug!(?replica_key, "partition already exists"); } } partitions