refactor(replication): isolate storage api contracts (#4240)

* refactor(replication): isolate storage api contracts

* docs(replication): record storage api contract boundary
This commit is contained in:
Zhengchao An
2026-07-03 22:10:16 +08:00
committed by GitHub
parent 6a81445a96
commit 6839e57c96
8 changed files with 54 additions and 4 deletions
+6
View File
@@ -29,6 +29,12 @@ Contract crates must stay below implementation crates. Initial forbidden edges:
- `extension-schema -> rustfs`
- `extension-schema -> ecstore`
`rustfs-storage-api` may only expose storage-facing replication status/state
contracts through `crates/storage-api/src/replication.rs` while the underlying
wire types still live in `rustfs-filemeta`. This keeps the temporary dependency
centralized until those wire contracts can move without introducing a
`rustfs-replication` / `rustfs-storage-api` cycle.
Existing migration checks live in:
- `scripts/check_layer_dependencies.sh`
@@ -125,6 +125,9 @@ Current coupling:
- resync options, bucket/target resync status DTOs, status display labels, and
the persisted resync status wire format live in `crates/replication`, with
ECStore retaining only error mapping and MRF persistence locally;
- storage-api delete replication status/state helpers use the local
`crates/storage-api/src/replication.rs` contract boundary while the
underlying wire types remain in `rustfs-filemeta`;
- admin replication extension target filtering and resync request construction
stay behind the admin storage boundary instead of exposing replication work
DTO construction to handlers;
@@ -168,6 +171,10 @@ Required contracts before crate movement:
`crates/ecstore/src/bucket/replication/replication_filemeta_boundary.rs`,
while `FileInfo` remains in the storage boundary for storage trait bindings
and walk options.
- `StorageApiReplicationContracts`: storage-api delete DTO replication
state/status helpers are concentrated in `crates/storage-api/src/replication.rs`
until the underlying wire contracts can move without a
`rustfs-replication` / `rustfs-storage-api` dependency cycle.
- `ReplicationErrorBoundary`: ECStore error/result contracts and
replication-specific error classifiers. `crate::error` imports are
concentrated in