diff --git a/ecstore/src/disk/local.rs b/ecstore/src/disk/local.rs index 3f23819f2..5dfcb92d2 100644 --- a/ecstore/src/disk/local.rs +++ b/ecstore/src/disk/local.rs @@ -439,6 +439,7 @@ impl DiskAPI for LocalDisk { } async fn get_disk_id(&self) -> Option { + warn!("local get_disk_id"); // TODO: check format file let format_info = self.format_info.lock().await; @@ -446,8 +447,10 @@ impl DiskAPI for LocalDisk { // TODO: 判断源文件id,是否有效 } - async fn set_disk_id(&self, _id: Option) -> Result<()> { + async fn set_disk_id(&self, id: Option) -> Result<()> { // 本地不需要设置 + let mut format_info = self.format_info.lock().await; + format_info.id = id; Ok(()) } diff --git a/ecstore/src/peer.rs b/ecstore/src/peer.rs index 343817b79..241280c01 100644 --- a/ecstore/src/peer.rs +++ b/ecstore/src/peer.rs @@ -360,7 +360,7 @@ impl PeerS3Client for LocalPeerS3Client { .ok_or(Error::new(DiskError::VolumeNotFound)) } - async fn delete_bucket(&self, bucket: &str, opts: &DeleteBucketOptions) -> Result<()> { + async fn delete_bucket(&self, bucket: &str, _opts: &DeleteBucketOptions) -> Result<()> { let local_disks = all_local_disk().await; let mut futures = Vec::with_capacity(local_disks.len()); diff --git a/ecstore/src/sets.rs b/ecstore/src/sets.rs index d7a937463..8698b2103 100644 --- a/ecstore/src/sets.rs +++ b/ecstore/src/sets.rs @@ -2,6 +2,7 @@ use std::collections::HashMap; use futures::future::join_all; use http::HeaderMap; +use tracing::warn; use uuid::Uuid; use crate::{ @@ -55,6 +56,7 @@ impl Sets { let idx = i * set_drive_count + j; let mut disk = disks[idx].clone(); if disk.is_none() { + warn!("sets new set_drive {}-{} is none", i, j); set_drive.push(None); continue; } @@ -66,6 +68,7 @@ impl Sets { }; if local_disk.is_none() { + warn!("sets new set_drive {}-{} local_disk is none", i, j); set_drive.push(None); continue; } @@ -78,10 +81,13 @@ impl Sets { if let Some(_disk_id) = disk.as_ref().unwrap().get_disk_id().await { set_drive.push(disk); } else { + warn!("sets new set_drive {}-{} get_disk_id is none", i, j); set_drive.push(None); } } + warn!("sets new set_drive {:?}", &set_drive); + let set_disks = SetDisks { disks: set_drive, set_drive_count, @@ -320,7 +326,7 @@ impl StorageAPI for Sets { .await } - async fn delete_bucket(&self, _bucket: &str, opts: &DeleteBucketOptions) -> Result<()> { + async fn delete_bucket(&self, _bucket: &str, _opts: &DeleteBucketOptions) -> Result<()> { unimplemented!() } }