mirror of
https://github.com/deuxfleurs-org/garage.git
synced 2026-08-07 21:33:13 +00:00
More security: don't delete stuff too easily
This commit is contained in:
@@ -305,6 +305,9 @@ impl BlockManager {
|
||||
let ring = self.system.ring.borrow().clone();
|
||||
|
||||
let mut who = self.replication.replication_nodes(&hash, &ring);
|
||||
if who.len() < self.replication.write_quorum(&self.system) {
|
||||
return Err(Error::Message(format!("Not trying to offload block because we don't have a quorum of nodes to write to")));
|
||||
}
|
||||
who.retain(|id| *id != self.system.id);
|
||||
|
||||
let msg = Arc::new(Message::NeedBlockQuery(*hash));
|
||||
|
||||
Reference in New Issue
Block a user