diff --git a/docs/architecture/global-state-inventory.md b/docs/architecture/global-state-inventory.md index 8f243aecd..d56892687 100644 --- a/docs/architecture/global-state-inventory.md +++ b/docs/architecture/global-state-inventory.md @@ -39,7 +39,7 @@ migration PR removes or replaces each item. | State | Current boundary | Category | Migration stance | |---|---|---|---| | `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`, `rustfs/src/app/context/global.rs`, and storage compatibility APIs | Runtime migration target | Do not migrate first; it is tied to storage startup, IAM-after-storage AppContext publication, and data-plane resolver compatibility. The object-store resolver is now published from the AppContext owner path and no longer re-exported from the RustFS storage root. | +| `GLOBAL_OBJECT_API`, `GLOBAL_OBJECT_STORE_RESOLVER` | `crates/ecstore/src/runtime/global.rs`, `rustfs/src/app/context/global.rs`, and storage compatibility APIs | Runtime migration target | Do not migrate first; it is tied to storage startup, IAM-after-storage AppContext publication, and data-plane resolver compatibility. The object-store resolver is now published from the AppContext owner path, no longer re-exported from the RustFS storage root, and RustFS AppContext tests no longer use the old `new_object_layer_fn` fallback chain. | | `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_EXPIRY_STATE`, `GLOBAL_TRANSITION_STATE`, `GLOBAL_LIFECYCLE_SYS` | `crates/ecstore/src/bucket/lifecycle/*`, `crates/ecstore/src/runtime/global.rs`, and `crates/ecstore/src/runtime/sources.rs` | Runtime migration target | Lifecycle state globals now stay behind ECStore lifecycle owner helpers and ECStore runtime-source helpers; RustFS AppContext has expiry/transition state interfaces and resolver coverage, and daily tier stats derive from the transition-state handle instead of a separate context boundary; scanner expiry-state access still uses the ECStore runtime `expiry_state_handle` boundary until scanner gets an injected provider. | diff --git a/rustfs/src/app/context.rs b/rustfs/src/app/context.rs index 86c4f795f..bd2d9e1af 100644 --- a/rustfs/src/app/context.rs +++ b/rustfs/src/app/context.rs @@ -876,10 +876,6 @@ mod tests { }; let endpoint_pools = EndpointServerPools(vec![pool_endpoints]); - if let Some(store) = runtime_sources::object_store() { - return (temp_dir, store, endpoint_pools); - } - init_local_disks(endpoint_pools.clone()).await.expect("test local disks"); let store = ECStore::new( "127.0.0.1:0".parse().expect("test addr"), diff --git a/rustfs/src/app/context/runtime_sources.rs b/rustfs/src/app/context/runtime_sources.rs index 02bf63bb1..54c0ff875 100644 --- a/rustfs/src/app/context/runtime_sources.rs +++ b/rustfs/src/app/context/runtime_sources.rs @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -#[cfg(test)] -use super::super::storage_api::context::ECStore; use super::super::storage_api::context::EndpointServerPools; use super::super::storage_api::context::bucket::metadata_sys::BucketMetadataSys; use super::super::storage_api::context::runtime::{ @@ -185,11 +183,6 @@ pub fn transition_state() -> Arc { get_global_transition_state() } -#[cfg(test)] -pub fn object_store() -> Option> { - super::super::storage_api::context::runtime::new_object_layer_fn() -} - pub fn server_config() -> Option { get_global_server_config() } diff --git a/rustfs/src/app/storage_api.rs b/rustfs/src/app/storage_api.rs index 3d72aa10d..5dbfa70e4 100644 --- a/rustfs/src/app/storage_api.rs +++ b/rustfs/src/app/storage_api.rs @@ -176,11 +176,6 @@ pub(crate) mod runtime { crate::storage::storage_api::get_global_transition_state() } - #[cfg(test)] - pub(crate) fn new_object_layer_fn() -> Option> { - crate::storage::storage_api::ecstore_global::new_object_layer_fn() - } - pub(crate) fn set_object_store_resolver(resolver: Arc) -> bool { crate::storage::storage_api::set_object_store_resolver(resolver) } diff --git a/rustfs/src/storage/storage_api.rs b/rustfs/src/storage/storage_api.rs index a6a9d67d3..399bba2fb 100644 --- a/rustfs/src/storage/storage_api.rs +++ b/rustfs/src/storage/storage_api.rs @@ -375,8 +375,6 @@ pub(crate) mod ecstore_event { } pub(crate) mod ecstore_global { - #[cfg(test)] - pub(crate) use rustfs_ecstore::api::global::new_object_layer_fn; pub(crate) use rustfs_ecstore::api::global::{ get_global_bucket_monitor, get_global_deployment_id, get_global_endpoints_opt, get_global_lock_client, get_global_lock_clients, get_global_region, global_rustfs_port, is_dist_erasure, set_global_endpoints, set_global_region, diff --git a/scripts/check_architecture_migration_rules.sh b/scripts/check_architecture_migration_rules.sh index 47446010f..290350446 100755 --- a/scripts/check_architecture_migration_rules.sh +++ b/scripts/check_architecture_migration_rules.sh @@ -338,6 +338,7 @@ RUSTFS_STORAGE_OWNER_RPC_ROOT_CONSUMER_HITS_FILE="${TMP_DIR}/rustfs_storage_owne RUSTFS_STORAGE_OWNER_WILDCARD_IMPORT_HITS_FILE="${TMP_DIR}/rustfs_storage_owner_wildcard_import_hits.txt" RUSTFS_STORAGE_OWNER_ROOT_EXPORT_GLOB_HITS_FILE="${TMP_DIR}/rustfs_storage_owner_root_export_glob_hits.txt" RUSTFS_STORAGE_OWNER_RUNTIME_ROOT_EXPORT_HITS_FILE="${TMP_DIR}/rustfs_storage_owner_runtime_root_export_hits.txt" +RUSTFS_OBJECT_LAYER_FALLBACK_BYPASS_HITS_FILE="${TMP_DIR}/rustfs_object_layer_fallback_bypass_hits.txt" RUSTFS_STORAGE_FACADE_DIRECT_OWNER_BYPASS_HITS_FILE="${TMP_DIR}/rustfs_storage_facade_direct_owner_bypass_hits.txt" RUSTFS_STORAGE_OWNER_SSE_ROOT_EXPORT_HITS_FILE="${TMP_DIR}/rustfs_storage_owner_sse_root_export_hits.txt" RUSTFS_STORAGE_OWNER_TEST_ROOT_CONSUMER_HITS_FILE="${TMP_DIR}/rustfs_storage_owner_test_root_consumer_hits.txt" @@ -2197,6 +2198,17 @@ if [[ -s "$RUSTFS_STORAGE_OWNER_RUNTIME_ROOT_EXPORT_HITS_FILE" ]]; then report_failure "RustFS storage owner root must not re-export object-store resolver or raw ECStore global facades: $(paste -sd '; ' "$RUSTFS_STORAGE_OWNER_RUNTIME_ROOT_EXPORT_HITS_FILE")" fi +( + cd "$ROOT_DIR" + rg -n --with-filename '\bnew_object_layer_fn\b' \ + rustfs/src \ + --glob '*.rs' || true +) >"$RUSTFS_OBJECT_LAYER_FALLBACK_BYPASS_HITS_FILE" + +if [[ -s "$RUSTFS_OBJECT_LAYER_FALLBACK_BYPASS_HITS_FILE" ]]; then + report_failure "RustFS AppContext/storage facades must not use the legacy object-layer fallback helper: $(paste -sd '; ' "$RUSTFS_OBJECT_LAYER_FALLBACK_BYPASS_HITS_FILE")" +fi + ( cd "$ROOT_DIR" rg --pcre2 -n --with-filename \