From e95318092cf85bd87e11d56f3775b292fe24f48e Mon Sep 17 00:00:00 2001 From: junxiang Mu <1948535941@qq.com> Date: Wed, 18 Dec 2024 10:52:23 +0800 Subject: [PATCH] add tick check disk Signed-off-by: junxiang Mu <1948535941@qq.com> --- ecstore/src/disk/local.rs | 2 +- ecstore/src/set_disk.rs | 3 ++- ecstore/src/sets.rs | 1 + ecstore/src/store.rs | 1 + 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ecstore/src/disk/local.rs b/ecstore/src/disk/local.rs index 762962466..0fdd18aad 100644 --- a/ecstore/src/disk/local.rs +++ b/ecstore/src/disk/local.rs @@ -762,7 +762,7 @@ impl DiskAPI for LocalDisk { self.endpoint.host_port() } async fn is_online(&self) -> bool { - true + self.check_format_json().await.is_ok() } fn endpoint(&self) -> Endpoint { diff --git a/ecstore/src/set_disk.rs b/ecstore/src/set_disk.rs index 52ac00b01..050e16f5e 100644 --- a/ecstore/src/set_disk.rs +++ b/ecstore/src/set_disk.rs @@ -1238,6 +1238,7 @@ impl SetDisks { for (i, opdisk) in disks.iter().enumerate() { if let Some(disk) = opdisk { if disk.is_online().await && disk.get_disk_location().set_idx.is_some() { + info!("Disk {:?} is online", disk); continue; } @@ -1245,6 +1246,7 @@ impl SetDisks { } if let Some(endpoint) = self.set_endpoints.get(i) { + info!("will renew disk, opdisk: {:?}", opdisk); self.renew_disk(endpoint).await; } } @@ -2901,7 +2903,6 @@ impl SetDisks { info!("ns_scanner start"); let _ = join_all(futures).await; drop(buckets_results_tx); - info!("1"); let _ = task.await; info!("ns_scanner completed"); Ok(()) diff --git a/ecstore/src/sets.rs b/ecstore/src/sets.rs index 4219f3b2c..60124bbed 100644 --- a/ecstore/src/sets.rs +++ b/ecstore/src/sets.rs @@ -612,6 +612,7 @@ impl StorageAPI for Sets { res.after.drives.push(v.clone()); } if DiskError::UnformattedDisk.count_errs(&errs) == 0 { + info!("disk formats success, NoHealRequired, errs: {:?}", errs); return Ok((res, Some(Error::new(DiskError::NoHealRequired)))); } diff --git a/ecstore/src/store.rs b/ecstore/src/store.rs index 1cfa879b5..f8bf22e00 100644 --- a/ecstore/src/store.rs +++ b/ecstore/src/store.rs @@ -1935,6 +1935,7 @@ impl StorageAPI for ECStore { r.after.drives.append(&mut result.after.drives); } if count_no_heal == self.pools.len() { + info!("heal format success, NoHealRequired"); return Ok((r, Some(Error::new(DiskError::NoHealRequired)))); } info!("heal format success result: {:?}", r);