fix(ecstore): log missing local paths during physical disk independence checks (#2680)

This commit is contained in:
houseme
2026-04-25 16:01:01 +08:00
committed by GitHub
parent 1e9c75a201
commit 81854762d4
3 changed files with 19 additions and 8 deletions
+2 -2
View File
@@ -176,7 +176,7 @@ impl LocalDisk {
let root = root_clone.clone();
Box::pin(async move {
match get_disk_info(root.clone()).await {
Ok((info, root_disk)) => {
Ok((info, is_root_disk)) => {
let physical_device_ids = match rustfs_utils::os::get_physical_device_ids(root.to_string_lossy().as_ref())
{
Ok(ids) => ids,
@@ -194,7 +194,7 @@ impl LocalDisk {
major: info.major,
minor: info.minor,
fs_type: info.fstype,
root_disk,
root_disk: is_root_disk,
physical_device_ids,
id: disk_id,
..Default::default()
+12 -1
View File
@@ -683,11 +683,15 @@ fn validate_local_physical_disk_independence(pools: &[Endpoints]) -> Result<()>
}
let mut device_paths = BTreeMap::<String, BTreeSet<String>>::new();
let mut missing_paths = Vec::new();
for path in &local_paths {
let canonical = match rustfs_utils::canonicalize(path) {
Ok(path) => path,
Err(err) if err.kind() == ErrorKind::NotFound => continue,
Err(err) if err.kind() == ErrorKind::NotFound => {
missing_paths.push(path.clone());
continue;
}
Err(err) => {
return Err(Error::other(format!(
"failed to resolve local endpoint path '{path}' for disk validation: {err}"
@@ -704,6 +708,13 @@ fn validate_local_physical_disk_independence(pools: &[Endpoints]) -> Result<()>
}
}
if !missing_paths.is_empty() {
warn!(
missing_paths = ?missing_paths,
"Excluding non-existent local endpoint paths from physical disk independence validation during endpoint parsing",
);
}
let shared_devices = device_paths
.into_iter()
.filter_map(|(device_id, paths)| {