From 4dc63b2bc2c3559b0d21ae5a749f63b49d997f91 Mon Sep 17 00:00:00 2001 From: Felipe Cardozo Date: Fri, 25 Oct 2024 21:43:34 -0300 Subject: [PATCH] fix: dispatch old partitions --- crates/fluvio-sc/src/stores/topic/store.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) 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