[lock-createbucket] Add node-global lock for bucket/key operations (fix #723)

This commit is contained in:
Alex Auvolat
2024-02-22 12:28:21 +01:00
parent 7e212e20e0
commit cff702a951
12 changed files with 511 additions and 476 deletions
+3 -3
View File
@@ -151,11 +151,11 @@ pub async fn handle_delete_key(
garage: &Arc<Garage>,
id: String,
) -> Result<Response<ResBody>, Error> {
let mut key = garage.key_helper().get_existing_key(&id).await?;
let helper = garage.locked_helper().await;
key.state.as_option().unwrap();
let mut key = helper.key().get_existing_key(&id).await?;
garage.key_helper().delete_key(&mut key).await?;
helper.delete_key(&mut key).await?;
Ok(Response::builder()
.status(StatusCode::NO_CONTENT)