fix(bucket-tenants): make tenant lifecycle and bucket import validation safer

This commit is contained in:
2026-05-02 12:09:13 +00:00
parent 7020810b5e
commit b075de1ecd
23 changed files with 435 additions and 183 deletions
+7 -11
View File
@@ -166,12 +166,7 @@ impl HealingService {
Ok(stats)
}
async fn heal_bucket(
&self,
bucket: &str,
offline_nodes: &[String],
stats: &mut HealStats,
) {
async fn heal_bucket(&self, bucket: &str, offline_nodes: &[String], stats: &mut HealStats) {
let bucket_dir = self.manifest_dir.join(bucket);
let manifests = match self.collect_manifests(&bucket_dir).await {
Ok(m) => m,
@@ -264,10 +259,10 @@ impl HealingService {
}
// Reconstruct all shards
let reconstructed = match self.erasure_coder.decode_chunk(
&mut shards,
chunk.data_size,
) {
let reconstructed = match self
.erasure_coder
.decode_chunk(&mut shards, chunk.data_size)
{
Ok(_) => true,
Err(e) => {
tracing::error!(
@@ -361,7 +356,8 @@ impl HealingService {
/// Collect all manifests under a bucket directory.
async fn collect_manifests(&self, dir: &std::path::Path) -> Result<Vec<ObjectManifest>> {
let mut manifests = Vec::new();
self.collect_manifests_recursive(dir, &mut manifests).await?;
self.collect_manifests_recursive(dir, &mut manifests)
.await?;
Ok(manifests)
}