Skip to content

Commit

Permalink
fix: dispatch old partitions
Browse files Browse the repository at this point in the history
  • Loading branch information
fraidev committed Oct 26, 2024
1 parent b650cae commit 4dc63b2
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions crates/fluvio-sc/src/stores/topic/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4dc63b2

Please sign in to comment.