fix(bucket-tenants): make tenant lifecycle and bucket import validation safer
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user