mirror of
https://github.com/rustfs/rustfs.git
synced 2026-01-17 09:40:32 +00:00
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user