diff --git a/ecstore/src/heal/data_usage_cache.rs b/ecstore/src/heal/data_usage_cache.rs index c21a35441..2e459e2a9 100644 --- a/ecstore/src/heal/data_usage_cache.rs +++ b/ecstore/src/heal/data_usage_cache.rs @@ -4,7 +4,7 @@ use crate::disk::{BUCKET_META_PREFIX, RUSTFS_META_BUCKET}; use crate::error::{Error, Result}; use crate::new_object_layer_fn; use crate::set_disk::SetDisks; -use crate::store_api::{BucketInfo, HTTPRangeSpec, ObjectIO, ObjectOptions}; +use crate::store_api::{BucketInfo, ObjectIO, ObjectOptions}; use bytesize::ByteSize; use http::HeaderMap; use path_clean::PathClean; diff --git a/ecstore/src/heal/mrf.rs b/ecstore/src/heal/mrf.rs index c2375abfa..3b31c9db3 100644 --- a/ecstore/src/heal/mrf.rs +++ b/ecstore/src/heal/mrf.rs @@ -2,7 +2,7 @@ use crate::disk::{BUCKET_META_PREFIX, RUSTFS_META_BUCKET}; use crate::heal::background_heal_ops::{heal_bucket, heal_object}; use crate::heal::heal_commands::{HEAL_DEEP_SCAN, HEAL_NORMAL_SCAN}; use crate::utils::path::SLASH_SEPARATOR; -use chrono::{DateTime, TimeDelta, Utc}; +use chrono::{DateTime, Utc}; use lazy_static::lazy_static; use regex::Regex; use std::ops::Sub; @@ -15,7 +15,7 @@ use tracing::error; use uuid::Uuid; pub const MRF_OPS_QUEUE_SIZE: u64 = 100000; -pub const HEAL_DIR: &'static str = ".heal"; +pub const HEAL_DIR: &str = ".heal"; pub const HEAL_MRFMETA_FORMAT: u64 = 1; pub const HEAL_MRFMETA_VERSION_V1: u64 = 1; @@ -49,6 +49,12 @@ pub struct MRFState { closing: AtomicBool, } +impl Default for MRFState { + fn default() -> Self { + Self::new() + } +} + impl MRFState { pub fn new() -> MRFState { let (tx, rx) = tokio::sync::mpsc::channel(MRF_OPS_QUEUE_SIZE as usize); @@ -89,29 +95,27 @@ impl MRFState { if let Err(err) = heal_bucket(&op.bucket).await { error!("heal bucket failed, bucket: {}, err: {:?}", op.bucket, err); } + } else if op.versions.is_empty() { + if let Err(err) = + heal_object(&op.bucket, &op.object, &op.version_id.clone().unwrap_or_default(), scan_mode).await + { + error!("heal object failed, bucket: {}, object: {}, err: {:?}", op.bucket, op.object, err); + } } else { - if op.versions.is_empty() { - if let Err(err) = - heal_object(&op.bucket, &op.object, &op.version_id.clone().unwrap_or_default(), scan_mode).await - { - error!("heal object failed, bucket: {}, object: {}, err: {:?}", op.bucket, op.object, err); - } - } else { - let vers = op.versions.len() / 16; - if vers > 0 { - for i in 0..vers { - let start = i * 16; - let end = start + 16; - if let Err(err) = heal_object( - &op.bucket, - &op.object, - &Uuid::from_slice(&op.versions[start..end]).expect("").to_string(), - scan_mode, - ) - .await - { - error!("heal object failed, bucket: {}, object: {}, err: {:?}", op.bucket, op.object, err); - } + let vers = op.versions.len() / 16; + if vers > 0 { + for i in 0..vers { + let start = i * 16; + let end = start + 16; + if let Err(err) = heal_object( + &op.bucket, + &op.object, + &Uuid::from_slice(&op.versions[start..end]).expect("").to_string(), + scan_mode, + ) + .await + { + error!("heal object failed, bucket: {}, object: {}, err: {:?}", op.bucket, op.object, err); } } } diff --git a/iam/src/policy/utils/wildcard.rs b/iam/src/policy/utils/wildcard.rs index b4451c9f1..dc2d47b54 100644 --- a/iam/src/policy/utils/wildcard.rs +++ b/iam/src/policy/utils/wildcard.rs @@ -1,3 +1,4 @@ +#[allow(dead_code)] pub fn is_simple_match
(pattern: P, name: N) -> bool
where
P: AsRef (pattern: P, text: N) -> bool
where
P: AsRef