Skip to content

refactor(ecstore): add accessor methods for service globals#3226

Merged
overtrue merged 3 commits into
mainfrom
refactor/ecstore-phase3-services
Jun 5, 2026
Merged

refactor(ecstore): add accessor methods for service globals#3226
overtrue merged 3 commits into
mainfrom
refactor/ecstore-phase3-services

Conversation

@overtrue

@overtrue overtrue commented Jun 5, 2026

Copy link
Copy Markdown
Collaborator

Related Issues

Relates to https://github.com/rustfs/backlog/issues/653 (item 8, Phase 3)

Summary of Changes

Phase 3 of global singleton consolidation. Add ECStore accessor methods that delegate to process-global service singletons, providing a unified API through ECStore for accessing cross-cutting services.

New ECStore methods:

  • notification_system() — delegates to notification_sys global
  • bucket_metadata_sys() — delegates to bucket metadata global
  • endpoints() — delegates to endpoints global
  • region() — delegates to region global
  • tier_config_mgr() — delegates to tier config global
  • server_config() — delegates to server config global
  • storage_class() — delegates to storage class global

Design:

  • No local state — globals remain the single source of truth
  • Pure delegation — methods provide a unified entry point through ECStore
  • Once all callers migrate, globals can be removed

Verification

cargo test -p rustfs-ecstore --lib
cargo clippy -p rustfs-ecstore -- -D warnings
cargo fmt --all --check
  • 1161 tests pass
  • Clippy clean
  • Formatting clean

Impact

No behavioral changes. Pure API addition.

Additional Notes

N/A

Copilot AI review requested due to automatic review settings June 5, 2026 14:23
@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

CLA requirements are satisfied for this pull request.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a set of new ECStore accessor methods intended to centralize access to process-global service singletons, as part of the “global singleton consolidation” effort in rustfs-ecstore.

Changes:

  • Introduces ECStore methods that delegate to existing global getters for notification, bucket metadata, endpoints, region, tier config, server config, and storage class.
  • Keeps service state process-global (no new state stored on ECStore), exposing a unified API surface for call sites to migrate toward.

Comment thread crates/ecstore/src/store.rs
Comment thread crates/ecstore/src/store.rs
overtrue added 2 commits June 5, 2026 22:39
Phase 3 of global singleton consolidation. Add ECStore accessor
methods that delegate to process-global service singletons,
providing a unified API through ECStore.

New methods:
- notification_system() — delegates to notification_sys global
- bucket_metadata_sys() — delegates to bucket metadata global
- endpoints() — delegates to endpoints global
- region() — delegates to region global
- tier_config_mgr() — delegates to tier config global
- server_config() — delegates to server config global
- storage_class() — delegates to storage class global

1161 tests pass, clippy clean, formatting clean.
Address review comments: use imported functions instead of
crate:: paths to avoid unused import warnings.

1160 tests pass, clippy clean.
@overtrue overtrue force-pushed the refactor/ecstore-phase3-services branch from e28ea37 to c82157c Compare June 5, 2026 14:43
@overtrue overtrue enabled auto-merge June 5, 2026 14:44
@overtrue overtrue added this pull request to the merge queue Jun 5, 2026
Merged via the queue into main with commit 06acf49 Jun 5, 2026
8 checks passed
@overtrue overtrue deleted the refactor/ecstore-phase3-services branch June 5, 2026 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants