mirror of
https://github.com/rustfs/rustfs.git
synced 2026-07-26 16:28:15 +00:00
5a46819589
Phase 5 Slice 9 (backlog#939): move the lifecycle expiry state and transition state — two stateful service handles defined in bucket_lifecycle_ops — into the per-instance InstanceContext, following the lazy-materialization pattern from Slices 7-8. - InstanceContext gains `expiry_state: OnceLock<Arc<RwLock<ExpiryState>>>` and `transition_state: OnceLock<Arc<TransitionState>>`, each materialized lazily on first access (both constructors are cheap — empty worker vecs/channels, workers started later — so lazy init reproduces the eager static's create-once-then-share). - The lifecycle owner helpers `get_global_expiry_state` / `get_global_transition_state` and the runtime-source handles `expiry_state_handle` / `transition_state_handle` keep their signatures and route through the current instance's context; the two statics (and the now-unused lazy_static import) are removed. The scanner boundary and lifecycle-state arch guards still pass. Tests: expiry/transition state are stable within an instance (same Arc) and distinct across instances. Verification: cargo test -p rustfs-ecstore (20 instance-context tests green), cargo clippy -p rustfs-ecstore --all-targets (clean), make pre-commit (pass). Refs: backlog#939 (Phase 5, Slice 9).