feat: expose replication workload admission snapshot (#3606)

This commit is contained in:
安正超
2026-06-19 11:13:17 +08:00
committed by GitHub
parent 00ca3b7c1c
commit 7cb7aefc3b
5 changed files with 140 additions and 8 deletions
+22 -7
View File
@@ -5,18 +5,18 @@ Status values: `[ ]` not started, `[~]` in progress, `[x]` complete, `[!]` block
## Current Context
- Issue: [`rustfs/backlog#660`](https://github.com/rustfs/backlog/issues/660)
- Branch: `overtrue/arch-workload-admission-owner-snapshots`
- Baseline: `origin/main` after `rustfs/rustfs#3590`
(`8cf3c0bf0100d9d2234f08b48df31fd73b92ed43`).
- Branch: `overtrue/arch-scanner-replication-admission-snapshots`
- Baseline: `origin/main` after `rustfs/rustfs#3605`
(`00ca3b7c1c4ffbe98c0dd8530cb26b63e94c586a`).
- PR type for this branch: `consumer-migration`
- Runtime behavior changes: none.
- Rust code changes: expose read-only repair workload admission snapshots from
existing heal runtime counters.
- Rust code changes: extend read-only workload admission snapshots from heal
repair counters to replication runtime worker and queue counters.
- CI/script changes: extend migration guard coverage for RustFS workload
admission provider implementations.
- Docs changes: add RustFS heal provider notes to
- Docs changes: add RustFS replication provider notes to
[`workload-admission-contracts.md`](workload-admission-contracts.md) and
record the API-057/R-017 provider slice.
record the API-058/R-018 provider slice.
## Phase 0 Tasks
@@ -183,6 +183,21 @@ Status values: `[ ]` not started, `[~]` in progress, `[x]` complete, `[!]` block
check, migration and layer guards, formatting, diff hygiene, risk scan, and
three-expert review.
- [x] `API-058/R-018` Expose replication admission snapshot.
- Completed slice: extend the RustFS workload admission provider to map
existing replication worker and site queue counters to the `Replication`
workload class.
- Acceptance: replication admission pressure is observable through the
`rustfs-concurrency` workload snapshot contract without changing
replication queueing, channel capacity, worker resize, MRF, target dispatch,
or resync behavior.
- Must preserve: replication admission, queue channel capacity, worker resize
policy, MRF handling, target dispatch, resync behavior, and queue stats
accounting.
- Verification: focused workload admission tests, focused RustFS library
check, migration and layer guards, formatting, diff hygiene, risk scan, and
three-expert review.
- [x] `TEST-PRTYPE-001` Check PR type enum consistency.
- Acceptance: `./scripts/check_architecture_migration_rules.sh` parses the
allowed PR types from [`crate-boundaries.md`](crate-boundaries.md) and fails
@@ -75,3 +75,20 @@ from the heal runtime counters:
This is an observation surface only. Heal request admission, queue capacity,
priority merge/drop policy, task scheduling, retry handling, and repair
behavior are unchanged.
## Replication Snapshot Extraction
The RustFS integration layer now exposes a read-only replication admission
snapshot from the existing replication pool and queue statistics:
- `Replication` reports active regular, large-object, and MRF worker counts.
- `queued` reports the current site replication queue count when queue stats
are immediately observable.
- `limit` remains `None` because replication worker limits remain owned by the
async replication pool and resize policy.
- If the replication runtime has not initialized, or queue stats are currently
locked, the snapshot reports `Unknown` instead of blocking or guessing.
This is an observation surface only. Replication admission, queue channel
capacity, worker resize behavior, MRF handling, target dispatch, and resync
behavior are unchanged.