diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6643f468a..4b25904c6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -178,6 +178,44 @@ jobs: - name: Run rio-v2 clippy lints run: cargo clippy -p rustfs -p rustfs-ecstore --all-targets --features rio-v2 -- -D warnings + test-and-lint-protocols: + name: "Test and Lint (${{ matrix.features.name }})" + needs: skip-check + if: needs.skip-check.outputs.should_skip != 'true' + runs-on: ubicloud-standard-4 + timeout-minutes: 60 + strategy: + fail-fast: false + matrix: + features: + - name: swift + flags: "--features swift" + - name: sftp + flags: "--features sftp" + - name: no-default + flags: "--no-default-features" + env: + FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true" + steps: + - name: Checkout repository + uses: actions/checkout@v7 + + - name: Setup Rust environment + uses: ./.github/actions/setup + with: + rust-version: stable + cache-shared-key: ci-test-${{ matrix.features.name }}-${{ hashFiles('**/Cargo.lock') }} + github-token: ${{ secrets.GITHUB_TOKEN }} + cache-save-if: ${{ github.ref == 'refs/heads/main' }} + + - name: Run tests with ${{ matrix.features.name }} + run: | + cargo nextest run -p rustfs -p rustfs-protocols ${{ matrix.features.flags }} + + - name: Run clippy with ${{ matrix.features.name }} + run: | + cargo clippy -p rustfs -p rustfs-protocols --all-targets ${{ matrix.features.flags }} -- -D warnings + build-rustfs-debug-binary: name: Build RustFS Debug Binary needs: skip-check diff --git a/crates/checksums/src/base64.rs b/crates/checksums/src/base64.rs index d434a4f0b..3714e6621 100644 --- a/crates/checksums/src/base64.rs +++ b/crates/checksums/src/base64.rs @@ -11,7 +11,7 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -#![allow(dead_code)] +#![warn(dead_code)] // Gradually clean up; see https://github.com/rustfs/backlog/issues/742 use base64_simd::STANDARD; use std::error::Error; diff --git a/crates/ecstore/src/data_usage/mod.rs b/crates/ecstore/src/data_usage/mod.rs index 9d2176b50..73ab206cc 100644 --- a/crates/ecstore/src/data_usage/mod.rs +++ b/crates/ecstore/src/data_usage/mod.rs @@ -14,7 +14,11 @@ pub mod local_snapshot; -use crate::storage_api_contracts::{list::ListOperations as _, object::ObjectIO as _}; +use crate::storage_api_contracts::{ + bucket::{BucketOperations as _, BucketOptions}, + list::ListOperations as _, + object::ObjectIO as _, +}; use crate::{ bucket::{metadata_sys::get_replication_config, versioning::VersioningApi as _, versioning_sys::BucketVersioningSys}, config::com::read_config, @@ -463,7 +467,20 @@ pub async fn compute_bucket_usage(store: Arc, bucket_name: &str) -> Res } pub async fn refresh_versioned_bucket_usage_from_object_layer(store: Arc, data_usage_info: &mut DataUsageInfo) { - let buckets = data_usage_info.buckets_usage.keys().cloned().collect::>(); + let listed_bucket_names = match store + .list_bucket(&BucketOptions { + no_metadata: true, + ..Default::default() + }) + .await + { + Ok(buckets) => buckets.into_iter().map(|bucket| bucket.name).collect::>(), + Err(err) => { + debug!(error = %err, "failed to list buckets while refreshing versioned bucket usage"); + Vec::new() + } + }; + let buckets = bucket_names_for_versioned_refresh(data_usage_info, listed_bucket_names); let mut changed = false; for bucket in buckets { @@ -475,6 +492,7 @@ pub async fn refresh_versioned_bucket_usage_from_object_layer(store: Arc usage, Err(err) => { @@ -487,6 +505,7 @@ pub async fn refresh_versioned_bucket_usage_from_object_layer(store: Arc, +) -> Vec { + let mut buckets = data_usage_info.buckets_usage.keys().cloned().collect::>(); + buckets.extend(listed_bucket_names.into_iter().filter(|bucket| !bucket.is_empty())); + + let mut buckets = buckets.into_iter().collect::>(); + buckets.sort(); + buckets +} + async fn ensure_bucket_usage_cached(bucket: &str) { let cache = memory_cache().read().await; if cache.contains_key(bucket) { @@ -540,6 +571,17 @@ fn bucket_usage_counts_match(left: &BucketUsageInfo, right: &BucketUsageInfo) -> && left.delete_markers_count == right.delete_markers_count } +async fn replace_bucket_usage_memory_from_authoritative(bucket: &str, usage: BucketUsageInfo, refresh_started_at: SystemTime) { + let mut cache = memory_cache().write().await; + if let Some(existing) = cache.get(bucket) + && existing.usage_updated_at > refresh_started_at + { + return; + } + + cache.insert(bucket.to_string(), cached_bucket_usage_from_backend(usage, refresh_started_at)); +} + /// Fast in-memory update for immediate quota and admin usage consistency. pub async fn record_bucket_object_write_memory(bucket: &str, previous_current_size: Option, new_size: u64) { record_bucket_object_write_memory_inner(bucket, previous_current_size, new_size, false).await; @@ -1263,6 +1305,105 @@ mod tests { ); } + #[test] + fn versioned_refresh_bucket_names_include_live_buckets_without_usage_snapshot() { + let mut persisted = DataUsageInfo::default(); + persisted.buckets_usage.insert( + "bucket-a".to_string(), + BucketUsageInfo { + objects_count: 1, + versions_count: 1, + size: 10, + ..Default::default() + }, + ); + + let buckets = bucket_names_for_versioned_refresh(&persisted, vec!["bucket-b".to_string(), "bucket-a".to_string()]); + + assert_eq!(buckets, vec!["bucket-a".to_string(), "bucket-b".to_string()]); + } + + #[tokio::test] + #[serial] + async fn authoritative_versioned_refresh_replaces_stale_dirty_memory() { + clear_usage_memory_cache_for_test().await; + + let old_persisted = data_usage_info_for_test("bucket-a", 0, 0, SystemTime::now() - Duration::from_secs(10)); + replace_bucket_usage_memory_from_info(&old_persisted).await; + record_bucket_object_write_memory("bucket-a", None, 15).await; + + let authoritative = BucketUsageInfo { + objects_count: 1, + versions_count: 1, + delete_markers_count: 1, + size: 10, + ..Default::default() + }; + replace_bucket_usage_memory_from_authoritative("bucket-a", authoritative.clone(), SystemTime::now()).await; + + let mut response = old_persisted.clone(); + response.buckets_usage.insert("bucket-a".to_string(), authoritative); + response.bucket_sizes.insert("bucket-a".to_string(), 10); + response.calculate_totals(); + + apply_bucket_usage_memory_overlay(&mut response).await; + + assert_eq!(response.objects_total_count, 1); + assert_eq!(response.versions_total_count, 1); + assert_eq!(response.delete_markers_total_count, 1); + assert_eq!(response.objects_total_size, 10); + assert_eq!( + response.buckets_usage.get("bucket-a").map(|usage| ( + usage.objects_count, + usage.versions_count, + usage.delete_markers_count, + usage.size + )), + Some((1, 1, 1, 10)) + ); + } + + #[tokio::test] + #[serial] + async fn authoritative_versioned_refresh_preserves_newer_dirty_memory() { + clear_usage_memory_cache_for_test().await; + + let old_persisted = data_usage_info_for_test("bucket-a", 0, 0, SystemTime::now() - Duration::from_secs(10)); + replace_bucket_usage_memory_from_info(&old_persisted).await; + let refresh_started = SystemTime::now() - Duration::from_secs(1); + record_bucket_object_write_memory("bucket-a", None, 15).await; + + replace_bucket_usage_memory_from_authoritative( + "bucket-a", + BucketUsageInfo { + objects_count: 1, + versions_count: 1, + delete_markers_count: 1, + size: 10, + ..Default::default() + }, + refresh_started, + ) + .await; + + let mut response = old_persisted.clone(); + apply_bucket_usage_memory_overlay(&mut response).await; + + assert_eq!(response.objects_total_count, 1); + assert_eq!(response.versions_total_count, 1); + assert_eq!(response.delete_markers_total_count, 0); + assert_eq!(response.objects_total_size, 15); + assert_eq!( + response.buckets_usage.get("bucket-a").map(|usage| ( + usage.objects_count, + usage.versions_count, + usage.delete_markers_count, + usage.size + )), + Some((1, 1, 0, 15)) + ); + } + #[tokio::test] #[serial] async fn scanner_sync_preserves_dirty_delete_marker_with_later_snapshot() { diff --git a/crates/ecstore/src/lib.rs b/crates/ecstore/src/lib.rs index 0e4c42d92..ec93efc1f 100644 --- a/crates/ecstore/src/lib.rs +++ b/crates/ecstore/src/lib.rs @@ -1,4 +1,4 @@ -#![allow(dead_code)] +#![warn(dead_code)] // Gradually clean up dead code; see https://github.com/rustfs/backlog/issues/742 // Copyright 2024 RustFS Team // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/crates/obs/src/metrics/collectors/audit.rs b/crates/obs/src/metrics/collectors/audit.rs index 13700b1e1..a9b949bed 100644 --- a/crates/obs/src/metrics/collectors/audit.rs +++ b/crates/obs/src/metrics/collectors/audit.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#![allow(dead_code)] +#![warn(dead_code)] // Gradually clean up; see https://github.com/rustfs/backlog/issues/742 //! Audit metrics collector. //! diff --git a/crates/obs/src/metrics/collectors/cluster_config.rs b/crates/obs/src/metrics/collectors/cluster_config.rs index e079be17e..265124dea 100644 --- a/crates/obs/src/metrics/collectors/cluster_config.rs +++ b/crates/obs/src/metrics/collectors/cluster_config.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#![allow(dead_code)] +#![warn(dead_code)] // Gradually clean up; see https://github.com/rustfs/backlog/issues/742 //! Cluster config metrics collector. //! diff --git a/crates/obs/src/metrics/collectors/cluster_erasure_set.rs b/crates/obs/src/metrics/collectors/cluster_erasure_set.rs index 0a94b10a3..f1a7a75fe 100644 --- a/crates/obs/src/metrics/collectors/cluster_erasure_set.rs +++ b/crates/obs/src/metrics/collectors/cluster_erasure_set.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#![allow(dead_code)] +#![warn(dead_code)] // Gradually clean up; see https://github.com/rustfs/backlog/issues/742 //! Cluster erasure set metrics collector. //! diff --git a/crates/obs/src/metrics/collectors/cluster_health.rs b/crates/obs/src/metrics/collectors/cluster_health.rs index 2f579c163..069e519e0 100644 --- a/crates/obs/src/metrics/collectors/cluster_health.rs +++ b/crates/obs/src/metrics/collectors/cluster_health.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#![allow(dead_code)] +#![warn(dead_code)] // Gradually clean up; see https://github.com/rustfs/backlog/issues/742 //! Cluster health metrics collector. //! diff --git a/crates/obs/src/metrics/collectors/cluster_iam.rs b/crates/obs/src/metrics/collectors/cluster_iam.rs index a33330125..c70920f94 100644 --- a/crates/obs/src/metrics/collectors/cluster_iam.rs +++ b/crates/obs/src/metrics/collectors/cluster_iam.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#![allow(dead_code)] +#![warn(dead_code)] // Gradually clean up; see https://github.com/rustfs/backlog/issues/742 //! Cluster IAM metrics collector. //! diff --git a/crates/obs/src/metrics/collectors/cluster_usage.rs b/crates/obs/src/metrics/collectors/cluster_usage.rs index a1259402b..09b2fe818 100644 --- a/crates/obs/src/metrics/collectors/cluster_usage.rs +++ b/crates/obs/src/metrics/collectors/cluster_usage.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#![allow(dead_code)] +#![warn(dead_code)] // Gradually clean up; see https://github.com/rustfs/backlog/issues/742 //! Cluster usage metrics collector. //! diff --git a/crates/obs/src/metrics/collectors/dial9.rs b/crates/obs/src/metrics/collectors/dial9.rs index 4929f853d..9cd528628 100644 --- a/crates/obs/src/metrics/collectors/dial9.rs +++ b/crates/obs/src/metrics/collectors/dial9.rs @@ -17,7 +17,7 @@ //! This module provides metrics for monitoring the health and performance //! of the dial9 telemetry system itself. -#![allow(dead_code)] +#![warn(dead_code)] // Gradually clean up; see https://github.com/rustfs/backlog/issues/742 use crate::MetricType; use crate::metrics::report::PrometheusMetric; diff --git a/crates/obs/src/metrics/collectors/ilm.rs b/crates/obs/src/metrics/collectors/ilm.rs index 73d7dd0ba..3b0ed6bd0 100644 --- a/crates/obs/src/metrics/collectors/ilm.rs +++ b/crates/obs/src/metrics/collectors/ilm.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#![allow(dead_code)] +#![warn(dead_code)] // Gradually clean up; see https://github.com/rustfs/backlog/issues/742 //! ILM (Information Lifecycle Management) metrics collector. //! diff --git a/crates/obs/src/metrics/collectors/notification.rs b/crates/obs/src/metrics/collectors/notification.rs index 2c7d97f61..9515a8d85 100644 --- a/crates/obs/src/metrics/collectors/notification.rs +++ b/crates/obs/src/metrics/collectors/notification.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#![allow(dead_code)] +#![warn(dead_code)] // Gradually clean up; see https://github.com/rustfs/backlog/issues/742 //! Notification metrics collector. //! diff --git a/crates/obs/src/metrics/collectors/notification_target.rs b/crates/obs/src/metrics/collectors/notification_target.rs index 58d5d5309..49ee15563 100644 --- a/crates/obs/src/metrics/collectors/notification_target.rs +++ b/crates/obs/src/metrics/collectors/notification_target.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#![allow(dead_code)] +#![warn(dead_code)] // Gradually clean up; see https://github.com/rustfs/backlog/issues/742 use crate::metrics::report::PrometheusMetric; use crate::metrics::schema::notification_target::{ diff --git a/crates/obs/src/metrics/collectors/replication.rs b/crates/obs/src/metrics/collectors/replication.rs index 15e1b7ae9..010fa88f6 100644 --- a/crates/obs/src/metrics/collectors/replication.rs +++ b/crates/obs/src/metrics/collectors/replication.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#![allow(dead_code)] +#![warn(dead_code)] // Gradually clean up; see https://github.com/rustfs/backlog/issues/742 //! Replication metrics collector. //! diff --git a/crates/obs/src/metrics/collectors/request.rs b/crates/obs/src/metrics/collectors/request.rs index 66a1f4e0f..cfec09991 100644 --- a/crates/obs/src/metrics/collectors/request.rs +++ b/crates/obs/src/metrics/collectors/request.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#![allow(dead_code)] +#![warn(dead_code)] // Gradually clean up; see https://github.com/rustfs/backlog/issues/742 //! API request metrics collector. //! diff --git a/crates/obs/src/metrics/collectors/scanner.rs b/crates/obs/src/metrics/collectors/scanner.rs index f8e2abc55..88de41894 100644 --- a/crates/obs/src/metrics/collectors/scanner.rs +++ b/crates/obs/src/metrics/collectors/scanner.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#![allow(dead_code)] +#![warn(dead_code)] // Gradually clean up; see https://github.com/rustfs/backlog/issues/742 //! Scanner metrics collector. //! diff --git a/crates/obs/src/metrics/collectors/system_cpu.rs b/crates/obs/src/metrics/collectors/system_cpu.rs index 10f682c44..7c8019577 100644 --- a/crates/obs/src/metrics/collectors/system_cpu.rs +++ b/crates/obs/src/metrics/collectors/system_cpu.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#![allow(dead_code)] +#![warn(dead_code)] // Gradually clean up; see https://github.com/rustfs/backlog/issues/742 //! System CPU metrics collector. //! diff --git a/crates/obs/src/metrics/collectors/system_drive.rs b/crates/obs/src/metrics/collectors/system_drive.rs index 9829ba7b2..20c5fff73 100644 --- a/crates/obs/src/metrics/collectors/system_drive.rs +++ b/crates/obs/src/metrics/collectors/system_drive.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#![allow(dead_code)] +#![warn(dead_code)] // Gradually clean up; see https://github.com/rustfs/backlog/issues/742 //! System drive metrics collector. //! diff --git a/crates/obs/src/metrics/collectors/system_gpu.rs b/crates/obs/src/metrics/collectors/system_gpu.rs index 22d06420f..78af7bb44 100644 --- a/crates/obs/src/metrics/collectors/system_gpu.rs +++ b/crates/obs/src/metrics/collectors/system_gpu.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#![allow(dead_code)] +#![warn(dead_code)] // Gradually clean up; see https://github.com/rustfs/backlog/issues/742 //! System GPU metrics collector. //! diff --git a/crates/obs/src/metrics/collectors/system_memory.rs b/crates/obs/src/metrics/collectors/system_memory.rs index 78a4d625e..b17bfc398 100644 --- a/crates/obs/src/metrics/collectors/system_memory.rs +++ b/crates/obs/src/metrics/collectors/system_memory.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#![allow(dead_code)] +#![warn(dead_code)] // Gradually clean up; see https://github.com/rustfs/backlog/issues/742 //! System memory metrics collector. //! diff --git a/crates/obs/src/metrics/collectors/system_network.rs b/crates/obs/src/metrics/collectors/system_network.rs index 4392e398c..302ccb97f 100644 --- a/crates/obs/src/metrics/collectors/system_network.rs +++ b/crates/obs/src/metrics/collectors/system_network.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#![allow(dead_code)] +#![warn(dead_code)] // Gradually clean up; see https://github.com/rustfs/backlog/issues/742 //! System network metrics collector. //! diff --git a/crates/obs/src/metrics/collectors/system_process.rs b/crates/obs/src/metrics/collectors/system_process.rs index ebdcb2516..6467bf5fc 100644 --- a/crates/obs/src/metrics/collectors/system_process.rs +++ b/crates/obs/src/metrics/collectors/system_process.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#![allow(dead_code)] +#![warn(dead_code)] // Gradually clean up; see https://github.com/rustfs/backlog/issues/742 //! System process metrics collector. //! diff --git a/crates/obs/src/metrics/schema/audit.rs b/crates/obs/src/metrics/schema/audit.rs index 2d6855842..ebd955c51 100644 --- a/crates/obs/src/metrics/schema/audit.rs +++ b/crates/obs/src/metrics/schema/audit.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#![allow(dead_code)] +#![warn(dead_code)] // Gradually clean up; see https://github.com/rustfs/backlog/issues/742 use crate::{MetricDescriptor, MetricName, new_counter_md, new_gauge_md, subsystems}; use std::sync::LazyLock; diff --git a/crates/obs/src/metrics/schema/bucket.rs b/crates/obs/src/metrics/schema/bucket.rs index f007712e6..1084d2021 100644 --- a/crates/obs/src/metrics/schema/bucket.rs +++ b/crates/obs/src/metrics/schema/bucket.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#![allow(dead_code)] +#![warn(dead_code)] // Gradually clean up; see https://github.com/rustfs/backlog/issues/742 use crate::{MetricDescriptor, MetricName, new_counter_md, new_gauge_md, new_histogram_md, subsystems}; use std::sync::LazyLock; diff --git a/crates/obs/src/metrics/schema/bucket_replication.rs b/crates/obs/src/metrics/schema/bucket_replication.rs index fed8afcde..e74668900 100644 --- a/crates/obs/src/metrics/schema/bucket_replication.rs +++ b/crates/obs/src/metrics/schema/bucket_replication.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#![allow(dead_code)] +#![warn(dead_code)] // Gradually clean up; see https://github.com/rustfs/backlog/issues/742 use crate::{MetricDescriptor, MetricName, new_counter_md, new_gauge_md, subsystems}; use std::sync::LazyLock; diff --git a/crates/obs/src/metrics/schema/cluster.rs b/crates/obs/src/metrics/schema/cluster.rs index a4847759c..bfdba141f 100644 --- a/crates/obs/src/metrics/schema/cluster.rs +++ b/crates/obs/src/metrics/schema/cluster.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#![allow(dead_code)] +#![warn(dead_code)] // Gradually clean up; see https://github.com/rustfs/backlog/issues/742 use crate::{MetricDescriptor, MetricName, new_gauge_md, subsystems}; use std::sync::LazyLock; diff --git a/crates/obs/src/metrics/schema/cluster_config.rs b/crates/obs/src/metrics/schema/cluster_config.rs index 2b10d3fb2..791c32f1e 100644 --- a/crates/obs/src/metrics/schema/cluster_config.rs +++ b/crates/obs/src/metrics/schema/cluster_config.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#![allow(dead_code)] +#![warn(dead_code)] // Gradually clean up; see https://github.com/rustfs/backlog/issues/742 use crate::{MetricDescriptor, MetricName, new_gauge_md, subsystems}; use std::sync::LazyLock; diff --git a/crates/obs/src/metrics/schema/cluster_erasure_set.rs b/crates/obs/src/metrics/schema/cluster_erasure_set.rs index 3c496f92f..302953ffa 100644 --- a/crates/obs/src/metrics/schema/cluster_erasure_set.rs +++ b/crates/obs/src/metrics/schema/cluster_erasure_set.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#![allow(dead_code)] +#![warn(dead_code)] // Gradually clean up; see https://github.com/rustfs/backlog/issues/742 use crate::{MetricDescriptor, MetricName, new_gauge_md, subsystems}; use std::sync::LazyLock; diff --git a/crates/obs/src/metrics/schema/cluster_health.rs b/crates/obs/src/metrics/schema/cluster_health.rs index 444bfa927..000b84fb0 100644 --- a/crates/obs/src/metrics/schema/cluster_health.rs +++ b/crates/obs/src/metrics/schema/cluster_health.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#![allow(dead_code)] +#![warn(dead_code)] // Gradually clean up; see https://github.com/rustfs/backlog/issues/742 use crate::{MetricDescriptor, MetricName, new_gauge_md, subsystems}; use std::sync::LazyLock; diff --git a/crates/obs/src/metrics/schema/cluster_iam.rs b/crates/obs/src/metrics/schema/cluster_iam.rs index 9f8077259..b75ec4722 100644 --- a/crates/obs/src/metrics/schema/cluster_iam.rs +++ b/crates/obs/src/metrics/schema/cluster_iam.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#![allow(dead_code)] +#![warn(dead_code)] // Gradually clean up; see https://github.com/rustfs/backlog/issues/742 use crate::{MetricDescriptor, MetricName, new_counter_md, subsystems}; use std::sync::LazyLock; diff --git a/crates/obs/src/metrics/schema/cluster_notification.rs b/crates/obs/src/metrics/schema/cluster_notification.rs index 5fbedc67c..eab2bc14f 100644 --- a/crates/obs/src/metrics/schema/cluster_notification.rs +++ b/crates/obs/src/metrics/schema/cluster_notification.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#![allow(dead_code)] +#![warn(dead_code)] // Gradually clean up; see https://github.com/rustfs/backlog/issues/742 use crate::{MetricDescriptor, MetricName, new_counter_md, new_gauge_md, subsystems}; use std::sync::LazyLock; diff --git a/crates/obs/src/metrics/schema/cluster_usage.rs b/crates/obs/src/metrics/schema/cluster_usage.rs index 1991e69c3..9641de55d 100644 --- a/crates/obs/src/metrics/schema/cluster_usage.rs +++ b/crates/obs/src/metrics/schema/cluster_usage.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#![allow(dead_code)] +#![warn(dead_code)] // Gradually clean up; see https://github.com/rustfs/backlog/issues/742 use crate::{MetricDescriptor, MetricName, new_gauge_md, subsystems}; use std::sync::LazyLock; diff --git a/crates/obs/src/metrics/schema/ilm.rs b/crates/obs/src/metrics/schema/ilm.rs index 253464552..768306b8b 100644 --- a/crates/obs/src/metrics/schema/ilm.rs +++ b/crates/obs/src/metrics/schema/ilm.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#![allow(dead_code)] +#![warn(dead_code)] // Gradually clean up; see https://github.com/rustfs/backlog/issues/742 use crate::{MetricDescriptor, MetricName, new_counter_md, new_gauge_md, subsystems}; use std::sync::LazyLock; diff --git a/crates/obs/src/metrics/schema/node_bucket.rs b/crates/obs/src/metrics/schema/node_bucket.rs index fa006eb43..7adc9b435 100644 --- a/crates/obs/src/metrics/schema/node_bucket.rs +++ b/crates/obs/src/metrics/schema/node_bucket.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#![allow(dead_code)] +#![warn(dead_code)] // Gradually clean up; see https://github.com/rustfs/backlog/issues/742 use crate::{MetricDescriptor, MetricName, new_gauge_md, subsystems}; use std::sync::LazyLock; diff --git a/crates/obs/src/metrics/schema/node_disk.rs b/crates/obs/src/metrics/schema/node_disk.rs index fad52b6c7..1d68640c1 100644 --- a/crates/obs/src/metrics/schema/node_disk.rs +++ b/crates/obs/src/metrics/schema/node_disk.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#![allow(dead_code)] +#![warn(dead_code)] // Gradually clean up; see https://github.com/rustfs/backlog/issues/742 use crate::{MetricDescriptor, MetricName, MetricSubsystem, new_gauge_md}; use std::sync::LazyLock; diff --git a/crates/obs/src/metrics/schema/notification_target.rs b/crates/obs/src/metrics/schema/notification_target.rs index f3af7d89f..1e581b775 100644 --- a/crates/obs/src/metrics/schema/notification_target.rs +++ b/crates/obs/src/metrics/schema/notification_target.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#![allow(dead_code)] +#![warn(dead_code)] // Gradually clean up; see https://github.com/rustfs/backlog/issues/742 use crate::{MetricDescriptor, MetricName, new_counter_md, new_gauge_md, subsystems}; use std::sync::LazyLock; diff --git a/crates/obs/src/metrics/schema/process_resource.rs b/crates/obs/src/metrics/schema/process_resource.rs index 9c0c03e34..adb01628d 100644 --- a/crates/obs/src/metrics/schema/process_resource.rs +++ b/crates/obs/src/metrics/schema/process_resource.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#![allow(dead_code)] +#![warn(dead_code)] // Gradually clean up; see https://github.com/rustfs/backlog/issues/742 use crate::{MetricDescriptor, MetricName, MetricSubsystem, new_gauge_md}; use std::sync::LazyLock; diff --git a/crates/obs/src/metrics/schema/replication.rs b/crates/obs/src/metrics/schema/replication.rs index b9ee5e4df..cd5d6a101 100644 --- a/crates/obs/src/metrics/schema/replication.rs +++ b/crates/obs/src/metrics/schema/replication.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#![allow(dead_code)] +#![warn(dead_code)] // Gradually clean up; see https://github.com/rustfs/backlog/issues/742 use crate::{MetricDescriptor, MetricName, new_gauge_md, subsystems}; use std::sync::LazyLock; diff --git a/crates/obs/src/metrics/schema/request.rs b/crates/obs/src/metrics/schema/request.rs index be037d653..7a7e8b196 100644 --- a/crates/obs/src/metrics/schema/request.rs +++ b/crates/obs/src/metrics/schema/request.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#![allow(dead_code)] +#![warn(dead_code)] // Gradually clean up; see https://github.com/rustfs/backlog/issues/742 use crate::{MetricDescriptor, MetricName, MetricSubsystem, new_counter_md, new_gauge_md, subsystems}; use std::sync::LazyLock; diff --git a/crates/obs/src/metrics/schema/scanner.rs b/crates/obs/src/metrics/schema/scanner.rs index 7f3ac768a..4a83824ac 100644 --- a/crates/obs/src/metrics/schema/scanner.rs +++ b/crates/obs/src/metrics/schema/scanner.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#![allow(dead_code)] +#![warn(dead_code)] // Gradually clean up; see https://github.com/rustfs/backlog/issues/742 use crate::{MetricDescriptor, MetricName, new_counter_md, new_gauge_md, subsystems}; use std::sync::LazyLock; diff --git a/crates/obs/src/metrics/schema/system_cpu.rs b/crates/obs/src/metrics/schema/system_cpu.rs index 6a11b1526..9f276f0db 100644 --- a/crates/obs/src/metrics/schema/system_cpu.rs +++ b/crates/obs/src/metrics/schema/system_cpu.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#![allow(dead_code)] +#![warn(dead_code)] // Gradually clean up; see https://github.com/rustfs/backlog/issues/742 use crate::{MetricDescriptor, MetricName, new_gauge_md, subsystems}; /// CPU system-related metric descriptors diff --git a/crates/obs/src/metrics/schema/system_drive.rs b/crates/obs/src/metrics/schema/system_drive.rs index 2f0ddea33..1e28eed87 100644 --- a/crates/obs/src/metrics/schema/system_drive.rs +++ b/crates/obs/src/metrics/schema/system_drive.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#![allow(dead_code)] +#![warn(dead_code)] // Gradually clean up; see https://github.com/rustfs/backlog/issues/742 use crate::{MetricDescriptor, MetricName, new_counter_md, new_gauge_md, subsystems}; use std::sync::LazyLock; diff --git a/crates/obs/src/metrics/schema/system_gpu.rs b/crates/obs/src/metrics/schema/system_gpu.rs index 958e6cace..5aa42c564 100644 --- a/crates/obs/src/metrics/schema/system_gpu.rs +++ b/crates/obs/src/metrics/schema/system_gpu.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#![allow(dead_code)] +#![warn(dead_code)] // Gradually clean up; see https://github.com/rustfs/backlog/issues/742 //! GPU-related metric descriptors. //! diff --git a/crates/obs/src/metrics/schema/system_memory.rs b/crates/obs/src/metrics/schema/system_memory.rs index de45de6fd..d2478051d 100644 --- a/crates/obs/src/metrics/schema/system_memory.rs +++ b/crates/obs/src/metrics/schema/system_memory.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#![allow(dead_code)] +#![warn(dead_code)] // Gradually clean up; see https://github.com/rustfs/backlog/issues/742 use crate::{MetricDescriptor, MetricName, new_gauge_md, subsystems}; use std::sync::LazyLock; diff --git a/crates/obs/src/metrics/schema/system_network.rs b/crates/obs/src/metrics/schema/system_network.rs index 6ac2bc75d..b6aecc3b7 100644 --- a/crates/obs/src/metrics/schema/system_network.rs +++ b/crates/obs/src/metrics/schema/system_network.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#![allow(dead_code)] +#![warn(dead_code)] // Gradually clean up; see https://github.com/rustfs/backlog/issues/742 use crate::{MetricDescriptor, MetricName, new_counter_md, new_gauge_md, subsystems}; use std::sync::LazyLock; diff --git a/crates/obs/src/metrics/schema/system_network_host.rs b/crates/obs/src/metrics/schema/system_network_host.rs index cb0881b7b..ba7a2b663 100644 --- a/crates/obs/src/metrics/schema/system_network_host.rs +++ b/crates/obs/src/metrics/schema/system_network_host.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#![allow(dead_code)] +#![warn(dead_code)] // Gradually clean up; see https://github.com/rustfs/backlog/issues/742 use crate::{MetricDescriptor, MetricName, new_gauge_md, subsystems}; use std::sync::LazyLock; diff --git a/crates/obs/src/metrics/schema/system_process.rs b/crates/obs/src/metrics/schema/system_process.rs index 34b46157c..e139629d7 100644 --- a/crates/obs/src/metrics/schema/system_process.rs +++ b/crates/obs/src/metrics/schema/system_process.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#![allow(dead_code)] +#![warn(dead_code)] // Gradually clean up; see https://github.com/rustfs/backlog/issues/742 use crate::{MetricDescriptor, MetricName, new_counter_md, new_gauge_md, subsystems}; use std::sync::LazyLock; diff --git a/crates/obs/src/metrics/stats_collector.rs b/crates/obs/src/metrics/stats_collector.rs index 597397c33..86371c0f9 100644 --- a/crates/obs/src/metrics/stats_collector.rs +++ b/crates/obs/src/metrics/stats_collector.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#![allow(dead_code)] +#![warn(dead_code)] // Gradually clean up; see https://github.com/rustfs/backlog/issues/742 //! Statistics collection functions for metrics. //!