mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-18 02:33:15 +00:00
fix:delete_bucket skip when volume not empty
This commit is contained in:
+2
-2
@@ -146,7 +146,7 @@ impl S3PeerSys {
|
||||
|
||||
Ok(buckets)
|
||||
}
|
||||
async fn delete_bucket(&self, bucket: &str, opts: &DeleteBucketOptions) -> Result<()> {
|
||||
pub async fn delete_bucket(&self, bucket: &str, opts: &DeleteBucketOptions) -> Result<()> {
|
||||
let mut futures = Vec::with_capacity(self.clients.len());
|
||||
for cli in self.clients.iter() {
|
||||
futures.push(cli.delete_bucket(bucket, &opts));
|
||||
@@ -391,7 +391,7 @@ impl PeerS3Client for LocalPeerS3Client {
|
||||
let mut idx = 0;
|
||||
for err in errs {
|
||||
if err.is_none() && recreate {
|
||||
let _ = self.local_disks[idx].make_volume(bucket).await;
|
||||
let _ = local_disks[idx].make_volume(bucket).await;
|
||||
}
|
||||
|
||||
idx += 1;
|
||||
|
||||
@@ -488,6 +488,15 @@ impl StorageAPI for ECStore {
|
||||
|
||||
Ok(buckets)
|
||||
}
|
||||
|
||||
async fn delete_bucket(&self, bucket: &str, opts: &DeleteBucketOptions) -> Result<()> {
|
||||
self.peer_sys.delete_bucket(bucket, opts).await?;
|
||||
|
||||
// 删除meta
|
||||
self.delete_all(RUSTFS_META_BUCKET, format!("{}/{}", BUCKET_META_PREFIX, bucket).as_str())
|
||||
.await?;
|
||||
Ok(())
|
||||
}
|
||||
async fn make_bucket(&self, bucket: &str, opts: &MakeBucketOptions) -> Result<()> {
|
||||
// TODO: check valid bucket name
|
||||
|
||||
@@ -781,13 +790,4 @@ impl StorageAPI for ECStore {
|
||||
}
|
||||
unimplemented!()
|
||||
}
|
||||
|
||||
async fn delete_bucket(&self, bucket: &str, opts: &DeleteBucketOptions) -> Result<()> {
|
||||
self.peer_sys.delete_bucket(bucket, opts).await?;
|
||||
|
||||
// 删除meta
|
||||
self.delete_all(RUSTFS_META_BUCKET, format!("{}/{}", BUCKET_META_PREFIX, bucket).as_str())
|
||||
.await?;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user