mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-17 18:27:49 +00:00
fix(ecstore): log missing local paths during physical disk independence checks (#2680)
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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)| {
|
||||
|
||||
Reference in New Issue
Block a user