fix:make bucket exists (#428)

This commit is contained in:
weisd
2025-08-19 16:14:59 +08:00
committed by GitHub
parent 4a3325276d
commit 10c949af62
3 changed files with 11 additions and 9 deletions
+9 -6
View File
@@ -177,15 +177,17 @@ impl S3PeerSys {
let pools = cli.get_pools();
let idx = i;
if pools.unwrap_or_default().contains(&idx) {
per_pool_errs.push(errors[j].as_ref());
per_pool_errs.push(errors[j].clone());
}
// TODO: reduceWriteQuorumErrs
if let Some(pool_err) =
reduce_write_quorum_errs(&per_pool_errs, BUCKET_OP_IGNORED_ERRS, (per_pool_errs.len() / 2) + 1)
{
return Err(pool_err);
}
}
}
// TODO:
Ok(())
}
pub async fn list_bucket(&self, opts: &BucketOptions) -> Result<Vec<BucketInfo>> {
@@ -387,7 +389,6 @@ impl PeerS3Client for LocalPeerS3Client {
if opts.force_create && matches!(e, Error::VolumeExists) {
return Ok(());
}
Err(e)
}
}
@@ -405,7 +406,9 @@ impl PeerS3Client for LocalPeerS3Client {
}
}
// TODO: reduceWriteQuorumErrs
if let Some(err) = reduce_write_quorum_errs(&errs, BUCKET_OP_IGNORED_ERRS, (local_disks.len() / 2) + 1) {
return Err(err);
}
Ok(())
}
+1 -2
View File
@@ -1221,7 +1221,7 @@ impl StorageAPI for ECStore {
}
if let Err(err) = self.peer_sys.make_bucket(bucket, opts).await {
let err = err.into();
let err = to_object_err(err.into(), vec![bucket]);
if !is_err_bucket_exists(&err) {
let _ = self
.delete_bucket(
@@ -1234,7 +1234,6 @@ impl StorageAPI for ECStore {
)
.await;
}
return Err(err);
};
+1 -1
View File
@@ -311,7 +311,7 @@ impl S3 for FS {
.make_bucket(
&bucket,
&MakeBucketOptions {
force_create: true,
force_create: false, // TODO: force support
lock_enabled: object_lock_enabled_for_bucket.is_some_and(|v| v),
..Default::default()
},