diff --git a/crates/ecstore/src/runtime/global.rs b/crates/ecstore/src/runtime/global.rs index d8f5861b4..0bc671175 100644 --- a/crates/ecstore/src/runtime/global.rs +++ b/crates/ecstore/src/runtime/global.rs @@ -42,27 +42,28 @@ pub const DISK_RESERVE_FRACTION: f64 = 0.15; // These should be migrated to AppContext over time. // See issue #730 for migration plan. // -// Tier A (needs migration): GLOBAL_OBJECT_API, GLOBAL_IsErasure*, GLOBAL_LOCAL_DISK_*, -// GLOBAL_RootDiskThreshold, GLOBAL_LifecycleSys, GLOBAL_EventNotifier, etc. +// Tier A (needs migration): GLOBAL_OBJECT_API, GLOBAL_IS_ERASURE*, GLOBAL_LOCAL_DISK_*, +// GLOBAL_ROOT_DISK_THRESHOLD, GLOBAL_LIFECYCLE_SYS, GLOBAL_EVENT_NOTIFIER, etc. // Tier B (keep as static): GLOBAL_RUSTFS_PORT, GLOBAL_REGION, env var caches, etc. lazy_static! { static ref GLOBAL_RUSTFS_PORT: OnceLock = OnceLock::new(); static ref GLOBAL_DEPLOYMENT_ID: OnceLock = OnceLock::new(); pub static ref GLOBAL_OBJECT_API: OnceLock> = OnceLock::new(); - pub static ref GLOBAL_IsErasure: RwLock = RwLock::new(false); - pub static ref GLOBAL_IsDistErasure: RwLock = RwLock::new(false); - pub static ref GLOBAL_IsErasureSD: RwLock = RwLock::new(false); + pub static ref GLOBAL_IS_ERASURE: RwLock = RwLock::new(false); + pub static ref GLOBAL_IS_DIST_ERASURE: RwLock = RwLock::new(false); + pub static ref GLOBAL_IS_ERASURE_SD: RwLock = RwLock::new(false); pub static ref GLOBAL_LOCAL_DISK_MAP: Arc>>> = Arc::new(RwLock::new(HashMap::new())); pub static ref GLOBAL_LOCAL_DISK_ID_MAP: Arc>> = Arc::new(RwLock::new(HashMap::new())); pub static ref GLOBAL_LOCAL_DISK_SET_DRIVES: Arc> = Arc::new(RwLock::new(Vec::new())); - pub static ref GLOBAL_Endpoints: OnceLock = OnceLock::new(); - pub static ref GLOBAL_RootDiskThreshold: RwLock = RwLock::new(0); - pub static ref GLOBAL_TierConfigMgr: Arc> = TierConfigMgr::new(); - pub static ref GLOBAL_LifecycleSys: Arc = LifecycleSys::new(); - pub static ref GLOBAL_EventNotifier: Arc> = EventNotifier::new(); + pub static ref GLOBAL_ENDPOINTS: OnceLock = OnceLock::new(); + pub static ref GLOBAL_ROOT_DISK_THRESHOLD: RwLock = RwLock::new(0); + pub static ref GLOBAL_TIER_CONFIG_MGR: Arc> = TierConfigMgr::new(); + pub static ref GLOBAL_LIFECYCLE_SYS: Arc = LifecycleSys::new(); + pub static ref GLOBAL_EVENT_NOTIFIER: Arc> = EventNotifier::new(); pub static ref GLOBAL_BOOT_TIME: OnceCell = OnceCell::new(); - pub static ref GLOBAL_LocalNodeName: String = "127.0.0.1:9000".to_string(); - pub static ref GLOBAL_LocalNodeNameHex: String = rustfs_utils::crypto::hex(GLOBAL_LocalNodeName.as_bytes()); + pub static ref GLOBAL_LOCAL_NODE_NAME_FALLBACK: String = "127.0.0.1:9000".to_string(); + pub static ref GLOBAL_LOCAL_NODE_NAME_HEX_FALLBACK: String = + rustfs_utils::crypto::hex(GLOBAL_LOCAL_NODE_NAME_FALLBACK.as_bytes()); pub static ref GLOBAL_REGION: OnceLock = OnceLock::new(); pub static ref GLOBAL_LOCAL_LOCK_CLIENT: OnceLock> = OnceLock::new(); pub static ref GLOBAL_LOCK_CLIENTS: OnceLock>> = OnceLock::new(); @@ -145,9 +146,9 @@ pub fn get_global_deployment_id() -> Option { /// * None /// pub fn set_global_endpoints(eps: Vec) { - GLOBAL_Endpoints + GLOBAL_ENDPOINTS .set(EndpointServerPools::from(eps)) - .expect("GLOBAL_Endpoints should be initialized once during storage startup") + .expect("GLOBAL_ENDPOINTS should be initialized once during storage startup") } /// Get the global endpoints @@ -156,7 +157,7 @@ pub fn set_global_endpoints(eps: Vec) { /// * `EndpointServerPools` - The global endpoints /// pub fn get_global_endpoints() -> EndpointServerPools { - if let Some(eps) = GLOBAL_Endpoints.get() { + if let Some(eps) = GLOBAL_ENDPOINTS.get() { eps.clone() } else { EndpointServerPools::default() @@ -164,7 +165,7 @@ pub fn get_global_endpoints() -> EndpointServerPools { } pub fn get_global_endpoints_opt() -> Option { - GLOBAL_Endpoints.get().cloned() + GLOBAL_ENDPOINTS.get().cloned() } #[cfg(test)] @@ -179,7 +180,7 @@ pub async fn is_first_cluster_node_local() -> bool { } pub fn get_global_tier_config_mgr() -> Arc> { - GLOBAL_TierConfigMgr.clone() + GLOBAL_TIER_CONFIG_MGR.clone() } /// Create a new object layer instance @@ -225,7 +226,7 @@ pub async fn set_object_layer(o: Arc) { /// * `bool` - True if the setup type is distributed erasure coding, false otherwise /// pub async fn is_dist_erasure() -> bool { - let lock = GLOBAL_IsDistErasure.read().await; + let lock = GLOBAL_IS_DIST_ERASURE.read().await; *lock } @@ -235,7 +236,7 @@ pub async fn is_dist_erasure() -> bool { /// * `bool` - True if the setup type is erasure coding with single data center, false otherwise /// pub async fn is_erasure_sd() -> bool { - let lock = GLOBAL_IsErasureSD.read().await; + let lock = GLOBAL_IS_ERASURE_SD.read().await; *lock } @@ -245,7 +246,7 @@ pub async fn is_erasure_sd() -> bool { /// * `bool` - True if the setup type is erasure coding, false otherwise /// pub async fn is_erasure() -> bool { - let lock = GLOBAL_IsErasure.read().await; + let lock = GLOBAL_IS_ERASURE.read().await; *lock } @@ -257,22 +258,22 @@ pub async fn is_erasure() -> bool { /// # Returns /// * None pub async fn update_erasure_type(setup_type: SetupType) { - let mut is_erasure = GLOBAL_IsErasure.write().await; + let mut is_erasure = GLOBAL_IS_ERASURE.write().await; *is_erasure = setup_type == SetupType::Erasure; - let mut is_dist_erasure = GLOBAL_IsDistErasure.write().await; + let mut is_dist_erasure = GLOBAL_IS_DIST_ERASURE.write().await; *is_dist_erasure = setup_type == SetupType::DistErasure; if *is_dist_erasure { *is_erasure = true } - let mut is_erasure_sd = GLOBAL_IsErasureSD.write().await; + let mut is_erasure_sd = GLOBAL_IS_ERASURE_SD.write().await; *is_erasure_sd = setup_type == SetupType::ErasureSD; } // pub fn is_legacy() -> bool { -// if let Some(endpoints) = GLOBAL_Endpoints.get() { +// if let Some(endpoints) = GLOBAL_ENDPOINTS.get() { // endpoints.as_ref().len() == 1 && endpoints.as_ref()[0].legacy // } else { // false diff --git a/crates/ecstore/src/runtime/sources.rs b/crates/ecstore/src/runtime/sources.rs index c796a91d1..2df07d0cb 100644 --- a/crates/ecstore/src/runtime/sources.rs +++ b/crates/ecstore/src/runtime/sources.rs @@ -29,13 +29,13 @@ use crate::{ error::Result, layout::endpoints::{EndpointServerPools, SetupType}, runtime::global::{ - GLOBAL_BOOT_TIME, GLOBAL_EventNotifier, GLOBAL_IsErasureSD, GLOBAL_LOCAL_DISK_ID_MAP, GLOBAL_LOCAL_DISK_MAP, - GLOBAL_LOCAL_DISK_SET_DRIVES, GLOBAL_LifecycleSys, GLOBAL_LocalNodeName, GLOBAL_RootDiskThreshold, GLOBAL_TierConfigMgr, - TypeLocalDiskSetDrives, get_background_services_cancel_token, get_global_bucket_monitor, get_global_deployment_id, - get_global_endpoints, get_global_endpoints_opt, get_global_lock_clients, get_global_region, get_global_tier_config_mgr, - global_rustfs_port, init_global_bucket_monitor, is_dist_erasure, is_erasure, is_first_cluster_node_local, - resolve_object_store_handle, set_global_deployment_id, set_global_lock_client, set_global_lock_clients, set_object_layer, - update_erasure_type, + GLOBAL_BOOT_TIME, GLOBAL_EVENT_NOTIFIER, GLOBAL_IS_ERASURE_SD, GLOBAL_LIFECYCLE_SYS, GLOBAL_LOCAL_DISK_ID_MAP, + GLOBAL_LOCAL_DISK_MAP, GLOBAL_LOCAL_DISK_SET_DRIVES, GLOBAL_LOCAL_NODE_NAME_FALLBACK, GLOBAL_ROOT_DISK_THRESHOLD, + GLOBAL_TIER_CONFIG_MGR, TypeLocalDiskSetDrives, get_background_services_cancel_token, get_global_bucket_monitor, + get_global_deployment_id, get_global_endpoints, get_global_endpoints_opt, get_global_lock_clients, get_global_region, + get_global_tier_config_mgr, global_rustfs_port, init_global_bucket_monitor, is_dist_erasure, is_erasure, + is_first_cluster_node_local, resolve_object_store_handle, set_global_deployment_id, set_global_lock_client, + set_global_lock_clients, set_object_layer, update_erasure_type, }, services::batch_processor::{GlobalBatchProcessors, get_global_processors}, services::event_notification::EventNotifier, @@ -145,7 +145,7 @@ pub(crate) async fn setup_is_dist_erasure() -> bool { } pub async fn setup_is_erasure_sd() -> bool { - *GLOBAL_IsErasureSD.read().await + *GLOBAL_IS_ERASURE_SD.read().await } pub(crate) async fn current_setup_type() -> SetupType { @@ -173,7 +173,7 @@ pub(crate) async fn set_local_node_name(node_name: String) { } pub(crate) fn default_local_node_name() -> String { - GLOBAL_LocalNodeName.to_string() + GLOBAL_LOCAL_NODE_NAME_FALLBACK.to_string() } pub(crate) fn rustfs_port() -> u16 { @@ -212,10 +212,10 @@ pub(crate) async fn scanner_init_time() -> Option> } pub(crate) async fn root_disk_threshold_for_erasure_disk() -> Option { - if *GLOBAL_IsErasureSD.read().await { + if *GLOBAL_IS_ERASURE_SD.read().await { None } else { - Some(*GLOBAL_RootDiskThreshold.read().await) + Some(*GLOBAL_ROOT_DISK_THRESHOLD.read().await) } } @@ -349,7 +349,7 @@ pub fn global_tier_config_mgr() -> Arc> { } pub(crate) async fn bucket_lifecycle_config(bucket: &str) -> Option { - GLOBAL_LifecycleSys.get(bucket).await + GLOBAL_LIFECYCLE_SYS.get(bucket).await } pub(crate) fn delete_bucket_monitor_entry(bucket: &str) { @@ -384,7 +384,7 @@ pub(crate) fn local_disk_set_drives_handle() -> Arc Arc> { - GLOBAL_TierConfigMgr.clone() + GLOBAL_TIER_CONFIG_MGR.clone() } pub fn expiry_state_handle() -> Arc> { @@ -396,7 +396,7 @@ pub fn transition_state_handle() -> Arc { } pub(crate) fn event_notifier_handle() -> Arc> { - GLOBAL_EventNotifier.clone() + GLOBAL_EVENT_NOTIFIER.clone() } pub(crate) async fn local_disk_by_path(path: &str) -> Option { @@ -518,7 +518,7 @@ pub(crate) async fn initialize_local_disk_maps(endpoint_pools: EndpointServerPoo } pub(crate) async fn init_tier_config_mgr(store: Arc) -> Result<()> { - GLOBAL_TierConfigMgr.write().await.init(store).await + GLOBAL_TIER_CONFIG_MGR.write().await.init(store).await } #[cfg(test)] diff --git a/docs/architecture/global-state-inventory.md b/docs/architecture/global-state-inventory.md index 34f6271cb..ba75993b7 100644 --- a/docs/architecture/global-state-inventory.md +++ b/docs/architecture/global-state-inventory.md @@ -15,7 +15,7 @@ caches separate from runtime migration targets. |---|---:|---| | Rust source files | 1,252 | `rg --files -g '*.rs'` | | `OnceLock` references | 221 lines | `rg -n --glob '*.rs' 'OnceLock'` | -| `GLOBAL_*` references | 265 lines | `rg -n --glob '*.rs' '\bGLOBAL_[A-Za-z0-9_]*\b'` | +| `GLOBAL_*` references | 273 lines | `rg -n --glob '*.rs' '\bGLOBAL_[A-Za-z0-9_]*\b'` | | `static NAME:` definitions | 621 lines | `rg -n --glob '*.rs' '^\s*(pub(\([^)]*\))?\s+)?static(\s+mut)?\s+[A-Za-z_][A-Za-z0-9_]*\s*:'` | | `lazy_static!` `static ref` definitions | 58 lines | `rg -n --glob '*.rs' '^\s*(pub\s+)?static\s+ref\s+[A-Za-z_][A-Za-z0-9_]*\s*:'` | | `static mut` definitions | 0 lines | `rg -n --glob '*.rs' '^\s*(pub(\([^)]*\))?\s+)?static\s+mut\s+'` | @@ -29,7 +29,7 @@ caches separate from runtime migration targets. | Owner-local compatibility | Existing compatibility adapters that are allowed to read globals while callers migrate to AppContext-first or owner-local runtime-source APIs. | `rustfs/src/*/runtime_sources.rs`, `rustfs/src/*/storage_api.rs`, `crates/*/storage_api.rs` | | Test or fixture state | Static setup used by tests to amortize expensive ECStore setup or isolate compatibility harness state. | `rustfs/src/app/*_test.rs`, `crates/scanner/tests/*`, `crates/ecstore/src/**/tests` | | Cache or constant | Regexes, metrics descriptors, defaults, KVS registrations, headers, path constants, and small process caches that are not runtime ownership handles. | `crates/config`, `crates/obs/src/metrics`, `crates/utils`, `rustfs/src/server/readiness.rs` | -| Legacy naming or review-needed | Mixed-case `GLOBAL_*`, old MinIO-port naming, stale comments, or names that need owner confirmation before code movement. | `GLOBAL_IsErasure`, `GLOBAL_Endpoints`, `GLOBAL_LocalNodeName` | +| Legacy naming or review-needed | Remaining mixed-case `GLOBAL_*`, old MinIO-port naming, stale comments, or names that need owner confirmation before code movement. | `GLOBAL_ExpiryState`, `GLOBAL_TransitionState`, `GLOBAL_OBJECT_API` | ## Runtime Migration Inventory @@ -40,13 +40,13 @@ migration PR removes or replaces each item. |---|---|---|---| | `APP_CONTEXT_SINGLETON` | `rustfs/src/app/context/global.rs` | Owner-local compatibility | Keep as the context-first facade while no-context startup and embedded callers still exist. | | `GLOBAL_OBJECT_API`, `GLOBAL_OBJECT_STORE_RESOLVER` | `crates/ecstore/src/runtime/global.rs` | Runtime migration target | Do not migrate first; it is tied to storage startup, IAM-after-storage AppContext publication, and data-plane resolver compatibility. | -| `GLOBAL_Endpoints`, `GLOBAL_IsErasure`, `GLOBAL_IsDistErasure`, `GLOBAL_IsErasureSD`, `GLOBAL_RootDiskThreshold` | `crates/ecstore/src/runtime/global.rs` and `crates/ecstore/src/runtime/sources.rs` | Runtime migration target | Endpoint, setup-type, and root-disk-threshold access now stays behind ECStore runtime helpers; move endpoint ownership only after readiness and quorum behavior have explicit coverage. | +| `GLOBAL_ENDPOINTS`, `GLOBAL_IS_ERASURE`, `GLOBAL_IS_DIST_ERASURE`, `GLOBAL_IS_ERASURE_SD`, `GLOBAL_ROOT_DISK_THRESHOLD` | `crates/ecstore/src/runtime/global.rs` and `crates/ecstore/src/runtime/sources.rs` | Runtime migration target | Endpoint, setup-type, and root-disk-threshold access now stays behind ECStore runtime helpers; move endpoint ownership only after readiness and quorum behavior have explicit coverage. | | `GLOBAL_LOCAL_DISK_MAP`, `GLOBAL_LOCAL_DISK_ID_MAP`, `GLOBAL_LOCAL_DISK_SET_DRIVES` | `crates/ecstore/src/runtime/global.rs` and `crates/ecstore/src/runtime/sources.rs` | Runtime migration target | Local disk map, disk-id cache, and set-drive access now stay behind ECStore runtime-source helpers instead of direct global access; preserve disk lookup, remote/local classification, and test reset hooks in later ownership changes. | -| `GLOBAL_ExpiryState`, `GLOBAL_TransitionState`, `GLOBAL_LifecycleSys` | `crates/ecstore/src/bucket/lifecycle/*`, `crates/ecstore/src/runtime/global.rs`, and `crates/ecstore/src/runtime/sources.rs` | Runtime migration target | `GLOBAL_LifecycleSys` access now stays behind ECStore runtime-source helpers; scanner expiry-state access now uses the ECStore runtime `expiry_state_handle` boundary; `GLOBAL_ExpiryState` remains the first code-bearing ownership candidate because AppContext already has an `ExpiryStateInterface`, resolver, and tests. | +| `GLOBAL_ExpiryState`, `GLOBAL_TransitionState`, `GLOBAL_LIFECYCLE_SYS` | `crates/ecstore/src/bucket/lifecycle/*`, `crates/ecstore/src/runtime/global.rs`, and `crates/ecstore/src/runtime/sources.rs` | Runtime migration target | `GLOBAL_LIFECYCLE_SYS` access now stays behind ECStore runtime-source helpers; scanner expiry-state access now uses the ECStore runtime `expiry_state_handle` boundary; `GLOBAL_ExpiryState` remains the first code-bearing ownership candidate because AppContext already has an `ExpiryStateInterface`, resolver, and tests. | | `GLOBAL_REPLICATION_POOL`, `GLOBAL_REPLICATION_STATS`, `GLOBAL_BUCKET_MONITOR` | `crates/ecstore/src/bucket/replication/*`, `crates/ecstore/src/runtime/global.rs` | Runtime migration target | Replication pool/stat access now stays behind replication owner and ECStore runtime-source helpers; bucket-monitor direct access now stays behind ECStore runtime helpers while AppContext/runtime-source resolvers remain the caller boundary. | -| `GLOBAL_TierConfigMgr`, `GLOBAL_STORAGE_CLASS`, `GLOBAL_CONFIG_SYS`, `GLOBAL_SERVER_CONFIG` | `crates/ecstore/src/config`, `crates/config`, `rustfs/src/app/context/runtime_sources.rs` | Runtime migration target | Tier config manager reads and reloads now use the ECStore runtime-source helper; move remaining config state through config/runtime-source owners only, without combining storage-class behavior or persistence changes. | -| `GLOBAL_EventNotifier`, `GLOBAL_NotificationSys` | `crates/ecstore/src/runtime/global.rs`, `crates/ecstore/src/runtime/sources.rs`, and `crates/ecstore/src/services/*` | Runtime migration target | `GLOBAL_EventNotifier` access now stays behind ECStore runtime-source helpers; move remaining notification ownership only through notify/runtime-source boundaries. | -| `GLOBAL_BOOT_TIME`, `GLOBAL_BACKGROUND_SERVICES_CANCEL_TOKEN`, `GLOBAL_DEPLOYMENT_ID`, `GLOBAL_REGION`, `GLOBAL_RUSTFS_PORT`, `GLOBAL_LocalNodeName`, `GLOBAL_LocalNodeNameHex` | `crates/ecstore/src/runtime/global.rs`, `crates/ecstore/src/runtime/sources.rs` | Runtime migration target | Boot time, background service cancellation token reads, and ECStore local-node-name fallback reads now stay behind the ECStore runtime-source API; deployment ID, region, and port direct access now stays behind owner helpers until the remaining scalar handles migrate. | +| `GLOBAL_TIER_CONFIG_MGR`, `GLOBAL_STORAGE_CLASS`, `GLOBAL_CONFIG_SYS`, `GLOBAL_SERVER_CONFIG` | `crates/ecstore/src/config`, `crates/config`, `rustfs/src/app/context/runtime_sources.rs` | Runtime migration target | Tier config manager reads and reloads now use the ECStore runtime-source helper; move remaining config state through config/runtime-source owners only, without combining storage-class behavior or persistence changes. | +| `GLOBAL_EVENT_NOTIFIER`, `GLOBAL_NotificationSys` | `crates/ecstore/src/runtime/global.rs`, `crates/ecstore/src/runtime/sources.rs`, and `crates/ecstore/src/services/*` | Runtime migration target | `GLOBAL_EVENT_NOTIFIER` access now stays behind ECStore runtime-source helpers; move remaining notification ownership only through notify/runtime-source boundaries. | +| `GLOBAL_BOOT_TIME`, `GLOBAL_BACKGROUND_SERVICES_CANCEL_TOKEN`, `GLOBAL_DEPLOYMENT_ID`, `GLOBAL_REGION`, `GLOBAL_RUSTFS_PORT`, `GLOBAL_LOCAL_NODE_NAME_FALLBACK`, `GLOBAL_LOCAL_NODE_NAME_HEX_FALLBACK` | `crates/ecstore/src/runtime/global.rs`, `crates/ecstore/src/runtime/sources.rs` | Runtime migration target | Boot time, background service cancellation token reads, and ECStore local-node-name fallback reads now stay behind the ECStore runtime-source API; deployment ID, region, and port direct access now stays behind owner helpers until the remaining scalar handles migrate. | | `GLOBAL_LOCAL_LOCK_CLIENT`, `GLOBAL_LOCK_CLIENTS`, `GLOBAL_LOCK_MANAGER` | `crates/ecstore/src/runtime/global.rs`, `crates/lock` | Runtime migration target / process-global split | ECStore lock client direct access now stays behind ECStore runtime helpers; preserve lock quorum and lock client selection while keeping the process-level lock manager separate from endpoint-specific clients. | | `GLOBAL_CONN_MAP`, `GLOBAL_LOCAL_NODE_NAME`, `GLOBAL_RUSTFS_HOST`, `GLOBAL_RUSTFS_ADDR`, `GLOBAL_ROOT_CERT`, `GLOBAL_MTLS_IDENTITY`, `GLOBAL_OUTBOUND_TLS_GENERATION` | `crates/common`, `crates/tls-runtime`, `crates/ecstore/src/runtime/sources.rs` | Runtime migration target / process-global split | Internode connection cache, common local node name, RustFS host/address reads, and outbound TLS material reads are now owned behind `rustfs_common` helpers; migrate the remaining transport and TLS state only after internode transport and outbound TLS ownership are explicit, without changing cached channel reuse or TLS reload semantics. | | `GLOBAL_RUSTFS_RPC_SECRET` | `crates/credentials`, `crates/ecstore/src/runtime/sources.rs` | Runtime migration target / process-global split | RPC auth token writes now stay behind the `rustfs_credentials` helper boundary; migrate only if runtime secret ownership changes, preserving lazy environment and credential-derived token semantics. | diff --git a/scripts/check_architecture_migration_rules.sh b/scripts/check_architecture_migration_rules.sh index 5cf9b4576..eedbdb2e6 100755 --- a/scripts/check_architecture_migration_rules.sh +++ b/scripts/check_architecture_migration_rules.sh @@ -2541,38 +2541,38 @@ fi ( cd "$ROOT_DIR" - rg -n --with-filename '\bGLOBAL_Endpoints\b' \ + rg -n --with-filename '\bGLOBAL_(Endpoints|ENDPOINTS)\b' \ crates rustfs fuzz \ --glob '*.rs' | rg -v '^crates/ecstore/src/runtime/(global|sources)\.rs:' || true ) >"$GLOBAL_ENDPOINTS_BYPASS_HITS_FILE" if [[ -s "$GLOBAL_ENDPOINTS_BYPASS_HITS_FILE" ]]; then - report_failure "GLOBAL_Endpoints access must stay behind ECStore runtime helpers: $(paste -sd '; ' "$GLOBAL_ENDPOINTS_BYPASS_HITS_FILE")" + report_failure "GLOBAL_ENDPOINTS access must stay behind ECStore runtime helpers: $(paste -sd '; ' "$GLOBAL_ENDPOINTS_BYPASS_HITS_FILE")" fi ( cd "$ROOT_DIR" - rg -n --with-filename '\bGLOBAL_IsErasure\b' \ + rg -n --with-filename '\bGLOBAL_(IsErasure|IS_ERASURE)\b' \ crates rustfs fuzz \ --glob '*.rs' | rg -v '^crates/ecstore/src/runtime/(global|sources)\.rs:' || true ) >"$GLOBAL_IS_ERASURE_BYPASS_HITS_FILE" if [[ -s "$GLOBAL_IS_ERASURE_BYPASS_HITS_FILE" ]]; then - report_failure "GLOBAL_IsErasure access must stay behind ECStore runtime helpers: $(paste -sd '; ' "$GLOBAL_IS_ERASURE_BYPASS_HITS_FILE")" + report_failure "GLOBAL_IS_ERASURE access must stay behind ECStore runtime helpers: $(paste -sd '; ' "$GLOBAL_IS_ERASURE_BYPASS_HITS_FILE")" fi ( cd "$ROOT_DIR" - rg -n --with-filename '\bGLOBAL_IsDistErasure\b' \ + rg -n --with-filename '\bGLOBAL_(IsDistErasure|IS_DIST_ERASURE)\b' \ crates rustfs fuzz \ --glob '*.rs' | rg -v '^crates/ecstore/src/runtime/(global|sources)\.rs:' || true ) >"$GLOBAL_IS_DIST_ERASURE_BYPASS_HITS_FILE" if [[ -s "$GLOBAL_IS_DIST_ERASURE_BYPASS_HITS_FILE" ]]; then - report_failure "GLOBAL_IsDistErasure access must stay behind ECStore runtime helpers: $(paste -sd '; ' "$GLOBAL_IS_DIST_ERASURE_BYPASS_HITS_FILE")" + report_failure "GLOBAL_IS_DIST_ERASURE access must stay behind ECStore runtime helpers: $(paste -sd '; ' "$GLOBAL_IS_DIST_ERASURE_BYPASS_HITS_FILE")" fi ( @@ -2613,50 +2613,50 @@ fi ( cd "$ROOT_DIR" - rg -n --with-filename '\bGLOBAL_IsErasureSD\b' \ + rg -n --with-filename '\bGLOBAL_(IsErasureSD|IS_ERASURE_SD)\b' \ crates rustfs fuzz \ --glob '*.rs' | rg -v '^crates/ecstore/src/runtime/(global|sources)\.rs:' || true ) >"$GLOBAL_ERASURE_SD_BYPASS_HITS_FILE" if [[ -s "$GLOBAL_ERASURE_SD_BYPASS_HITS_FILE" ]]; then - report_failure "GLOBAL_IsErasureSD access must stay behind ECStore runtime-source helpers: $(paste -sd '; ' "$GLOBAL_ERASURE_SD_BYPASS_HITS_FILE")" + report_failure "GLOBAL_IS_ERASURE_SD access must stay behind ECStore runtime-source helpers: $(paste -sd '; ' "$GLOBAL_ERASURE_SD_BYPASS_HITS_FILE")" fi ( cd "$ROOT_DIR" - rg -n --with-filename '\bGLOBAL_RootDiskThreshold\b' \ + rg -n --with-filename '\bGLOBAL_(RootDiskThreshold|ROOT_DISK_THRESHOLD)\b' \ crates rustfs fuzz \ --glob '*.rs' | rg -v '^crates/ecstore/src/runtime/(global|sources)\.rs:' || true ) >"$GLOBAL_ROOT_DISK_THRESHOLD_BYPASS_HITS_FILE" if [[ -s "$GLOBAL_ROOT_DISK_THRESHOLD_BYPASS_HITS_FILE" ]]; then - report_failure "GLOBAL_RootDiskThreshold access must stay behind ECStore runtime-source helpers: $(paste -sd '; ' "$GLOBAL_ROOT_DISK_THRESHOLD_BYPASS_HITS_FILE")" + report_failure "GLOBAL_ROOT_DISK_THRESHOLD access must stay behind ECStore runtime-source helpers: $(paste -sd '; ' "$GLOBAL_ROOT_DISK_THRESHOLD_BYPASS_HITS_FILE")" fi ( cd "$ROOT_DIR" - rg -n --with-filename '\bGLOBAL_LifecycleSys\b' \ + rg -n --with-filename '\bGLOBAL_(LifecycleSys|LIFECYCLE_SYS)\b' \ crates rustfs fuzz \ --glob '*.rs' | rg -v '^crates/ecstore/src/runtime/(global|sources)\.rs:' || true ) >"$GLOBAL_LIFECYCLE_SYS_BYPASS_HITS_FILE" if [[ -s "$GLOBAL_LIFECYCLE_SYS_BYPASS_HITS_FILE" ]]; then - report_failure "GLOBAL_LifecycleSys access must stay behind ECStore runtime-source helpers: $(paste -sd '; ' "$GLOBAL_LIFECYCLE_SYS_BYPASS_HITS_FILE")" + report_failure "GLOBAL_LIFECYCLE_SYS access must stay behind ECStore runtime-source helpers: $(paste -sd '; ' "$GLOBAL_LIFECYCLE_SYS_BYPASS_HITS_FILE")" fi ( cd "$ROOT_DIR" - rg -n --with-filename '\bGLOBAL_EventNotifier\b' \ + rg -n --with-filename '\bGLOBAL_(EventNotifier|EVENT_NOTIFIER)\b' \ crates rustfs fuzz \ --glob '*.rs' | rg -v '^crates/ecstore/src/runtime/(global|sources)\.rs:' || true ) >"$GLOBAL_EVENT_NOTIFIER_BYPASS_HITS_FILE" if [[ -s "$GLOBAL_EVENT_NOTIFIER_BYPASS_HITS_FILE" ]]; then - report_failure "GLOBAL_EventNotifier access must stay behind ECStore runtime-source helpers: $(paste -sd '; ' "$GLOBAL_EVENT_NOTIFIER_BYPASS_HITS_FILE")" + report_failure "GLOBAL_EVENT_NOTIFIER access must stay behind ECStore runtime-source helpers: $(paste -sd '; ' "$GLOBAL_EVENT_NOTIFIER_BYPASS_HITS_FILE")" fi ( @@ -2673,14 +2673,14 @@ fi ( cd "$ROOT_DIR" - rg -n --with-filename '\bGLOBAL_LocalNodeName(Hex)?\b' \ + rg -n --with-filename '\bGLOBAL_(LocalNodeName(Hex)?|LOCAL_NODE_NAME(_HEX)?_FALLBACK)\b' \ crates rustfs fuzz \ --glob '*.rs' | rg -v '^crates/ecstore/src/runtime/(global|sources)\.rs:' || true ) >"$GLOBAL_ECSTORE_LOCAL_NODE_NAME_BYPASS_HITS_FILE" if [[ -s "$GLOBAL_ECSTORE_LOCAL_NODE_NAME_BYPASS_HITS_FILE" ]]; then - report_failure "GLOBAL_LocalNodeName/Hex access must stay behind ECStore runtime-source helpers: $(paste -sd '; ' "$GLOBAL_ECSTORE_LOCAL_NODE_NAME_BYPASS_HITS_FILE")" + report_failure "ECStore local node fallback globals must stay behind ECStore runtime-source helpers: $(paste -sd '; ' "$GLOBAL_ECSTORE_LOCAL_NODE_NAME_BYPASS_HITS_FILE")" fi ( @@ -2853,14 +2853,14 @@ fi ( cd "$ROOT_DIR" - rg -n --with-filename '\bGLOBAL_TierConfigMgr\b' \ + rg -n --with-filename '\bGLOBAL_(TierConfigMgr|TIER_CONFIG_MGR)\b' \ crates rustfs fuzz \ --glob '*.rs' | rg -v '^crates/ecstore/src/runtime/(global|sources)\.rs:' || true ) >"$GLOBAL_TIER_CONFIG_MGR_BYPASS_HITS_FILE" if [[ -s "$GLOBAL_TIER_CONFIG_MGR_BYPASS_HITS_FILE" ]]; then - report_failure "GLOBAL_TierConfigMgr access must stay behind ECStore runtime-source helpers: $(paste -sd '; ' "$GLOBAL_TIER_CONFIG_MGR_BYPASS_HITS_FILE")" + report_failure "GLOBAL_TIER_CONFIG_MGR access must stay behind ECStore runtime-source helpers: $(paste -sd '; ' "$GLOBAL_TIER_CONFIG_MGR_BYPASS_HITS_FILE")" fi (