fix: verify_file bug
This commit is contained in:
weisd
2025-04-24 15:14:57 +08:00
parent e251ffe85d
commit 91eb469a7d
3 changed files with 11 additions and 6 deletions

View File

@@ -1232,7 +1232,7 @@ impl DiskAPI for LocalDisk {
}
let mut resp = CheckPartsResp {
results: Vec::with_capacity(fi.parts.len()),
results: vec![0; fi.parts.len()],
};
let erasure = &fi.erasure;

View File

@@ -223,7 +223,7 @@ impl ECStore {
disk_map,
pools,
peer_sys,
pool_meta: pool_meta.into(),
pool_meta: RwLock::new(pool_meta),
rebalance_meta: RwLock::new(None),
decommission_cancelers,
});
@@ -268,7 +268,7 @@ impl ECStore {
meta.load(self.pools[0].clone(), self.pools.clone()).await?;
let update = meta.validate(self.pools.clone())?;
if update {
if !update {
{
let mut pool_meta = self.pool_meta.write().await;
*pool_meta = meta.clone();

View File

@@ -1,4 +1,5 @@
use ecstore::{
config::error::is_err_config_not_found,
new_object_layer_fn,
notification_sys::get_global_notification_sys,
rebalance::{DiskStat, RebalSaveOpt},
@@ -128,9 +129,13 @@ impl Operation for RebalanceStatus {
};
let mut meta = RebalanceMeta::new();
meta.load(store.pools[0].clone())
.await
.map_err(|e| s3_error!(InternalError, "Failed to load rebalance meta: {}", e))?;
if let Err(err) = meta.load(store.pools[0].clone()).await {
if is_err_config_not_found(&err) {
return Err(s3_error!(NoSuchResource, "Pool rebalance is not started"));
}
return Err(s3_error!(InternalError, "Failed to load rebalance meta: {}", err));
}
// Compute disk usage percentage
let si = store.storage_info().await;