diff --git a/crates/ecstore/src/admin_server_info.rs b/crates/ecstore/src/admin_server_info.rs index 0ee4b1b8..4ee7d94c 100644 --- a/crates/ecstore/src/admin_server_info.rs +++ b/crates/ecstore/src/admin_server_info.rs @@ -12,23 +12,18 @@ // See the License for the specific language governing permissions and // limitations under the License. +use crate::data_usage::{DATA_USAGE_CACHE_NAME, DATA_USAGE_ROOT, load_data_usage_from_backend}; use crate::error::{Error, Result}; use crate::{ disk::endpoint::Endpoint, global::{GLOBAL_BOOT_TIME, GLOBAL_Endpoints}, - heal::{ - data_usage::{DATA_USAGE_CACHE_NAME, DATA_USAGE_ROOT, load_data_usage_from_backend}, - data_usage_cache::DataUsageCache, - heal_commands::{DRIVE_STATE_OK, DRIVE_STATE_UNFORMATTED}, - }, new_object_layer_fn, notification_sys::get_global_notification_sys, store_api::StorageAPI, }; -use rustfs_common::{ - // error::{Error, Result}, - globals::GLOBAL_Local_Node_Name, -}; + +use crate::data_usage::load_data_usage_cache; +use rustfs_common::{globals::GLOBAL_Local_Node_Name, heal_channel::DriveState}; use rustfs_madmin::{ BackendDisks, Disk, ErasureSetInfo, ITEM_INITIALIZING, ITEM_OFFLINE, ITEM_ONLINE, InfoMessage, ServerProperties, }; @@ -318,7 +313,7 @@ fn get_online_offline_disks_stats(disks_info: &[Disk]) -> (BackendDisks, Backend for disk in disks_info { let ep = &disk.endpoint; let state = &disk.state; - if *state != DRIVE_STATE_OK && *state != DRIVE_STATE_UNFORMATTED { + if *state != DriveState::Ok.to_string() && *state != DriveState::Unformatted.to_string() { *offline_disks.get_mut(ep).unwrap() += 1; continue; } @@ -359,13 +354,13 @@ async fn get_pools_info(all_disks: &[Disk]) -> Result::new()); erasure_set.objects_count = data_usage_info.objects_total_count; erasure_set.versions_count = data_usage_info.versions_total_count; erasure_set.delete_markers_count = data_usage_info.delete_markers_total_count; diff --git a/rustfs/src/admin/handlers.rs b/rustfs/src/admin/handlers.rs index ab3a083c..3923fc63 100644 --- a/rustfs/src/admin/handlers.rs +++ b/rustfs/src/admin/handlers.rs @@ -23,15 +23,15 @@ use http::{HeaderMap, Uri}; use hyper::StatusCode; use matchit::Params; use percent_encoding::{AsciiSet, CONTROLS, percent_encode}; +use rustfs_common::heal_channel::HealOpts; use rustfs_ecstore::admin_server_info::get_server_info; use rustfs_ecstore::bucket::metadata_sys::{self, get_replication_config}; use rustfs_ecstore::bucket::target::BucketTarget; use rustfs_ecstore::bucket::versioning_sys::BucketVersioningSys; use rustfs_ecstore::cmd::bucket_targets::{self, GLOBAL_Bucket_Target_Sys}; +use rustfs_ecstore::data_usage::load_data_usage_from_backend; use rustfs_ecstore::error::StorageError; use rustfs_ecstore::global::get_global_action_cred; -use rustfs_ecstore::heal::data_usage::load_data_usage_from_backend; -use rustfs_ecstore::heal::heal_commands::HealOpts; use rustfs_ecstore::metrics_realtime::{CollectMetricsOpts, MetricType, collect_local_metrics}; use rustfs_ecstore::new_object_layer_fn; use rustfs_ecstore::pools::{get_total_usable_capacity, get_total_usable_capacity_free}; @@ -1095,7 +1095,7 @@ impl Operation for RemoveRemoteTargetHandler { #[cfg(test)] mod test { - use rustfs_ecstore::heal::heal_commands::HealOpts; + use rustfs_common::heal_channel::HealOpts; #[ignore] // FIXME: failed in github actions #[test]