diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/block.rs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/block.rs b/src/block.rs index 46abcf02..6c785f89 100644 --- a/src/block.rs +++ b/src/block.rs @@ -278,25 +278,25 @@ impl BlockManager { let who_needs = join_all(who_needs_fut).await; let mut need_nodes = vec![]; - let mut errors = 0; for (node, needed) in who.into_iter().zip(who_needs.iter()) { match needed { Ok(Message::NeedBlockReply(true)) => { need_nodes.push(node); } - Err(_) => { - errors += 1; + Err(e) => { + return Err(Error::Message(format!( + "Should delete block, but unable to confirm that all other nodes that need it have it: {}", + e + ))); + } + _ => { + return Err(Error::Message(format!( + "Unexpected response to NeedBlockQuery RPC" + ))); } - _ => (), } } - if errors > (garage.system.config.data_replication_factor - 1) / 2 { - return Err(Error::Message(format!( - "Should delete block, but not enough nodes confirm that they have it." - ))); - } - if need_nodes.len() > 0 { let put_block_message = self.read_block(hash).await?; let put_responses = self |