From 54e800ef8dec7f0e35733ce75cb3d214a48ca354 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Mon, 21 Nov 2022 17:13:41 +0100 Subject: Tentative fix for issue #414 --- src/rpc/layout.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/rpc/layout.rs b/src/rpc/layout.rs index f517f36f..2fd5acfc 100644 --- a/src/rpc/layout.rs +++ b/src/rpc/layout.rs @@ -254,9 +254,11 @@ To know the correct value of the new layout version, invoke `garage layout show` match self.initial_partition_assignation() { Some(initial_partitions) => { for (part, ipart) in partitions.iter_mut().zip(initial_partitions.iter()) { - for (id, info) in ipart.nodes.iter() { - if part.nodes.len() < self.replication_factor { - part.add(None, n_zones, id, info.unwrap()); + for _ in 0..2 { + for (id, info) in ipart.nodes.iter() { + if part.nodes.len() < self.replication_factor { + part.add(None, n_zones, id, info.unwrap()); + } } } assert!(part.nodes.len() == self.replication_factor); -- cgit v1.2.3