Begin implement bucket management & admin commands

This commit is contained in:
Alex Auvolat
2020-04-19 17:15:48 +02:00
parent 302502f4c1
commit a6129d8626
13 changed files with 433 additions and 55 deletions
+2 -2
View File
@@ -98,7 +98,7 @@ impl BlockManager {
Message::NeedBlockQuery(h) => {
self2.need_block(&h).await.map(Message::NeedBlockReply)
}
_ => Err(Error::Message(format!("Invalid RPC"))),
_ => Err(Error::BadRequest(format!("Unexpected RPC message"))),
}
}
});
@@ -262,7 +262,7 @@ impl BlockManager {
let garage = self.garage.load_full().unwrap();
let active_refs = garage
.block_ref_table
.get_range(&hash, &[0u8; 32].into(), Some(()), 1)
.get_range(&hash, None, Some(()), 1)
.await?;
let needed_by_others = !active_refs.is_empty();
if needed_by_others {