docs/architecture/workload-admission-contracts.md
This document records the rustfs/backlog#660 PR-05 and PR-07 scheduler
preservation and runtime workload-class contract slice.
The rustfs-concurrency tests pin the current reusable admission-facing
behavior before later snapshot extraction:
GetObjectQueueSnapshot preserves saturated, over-available, and zero-total
permit semantics.The former reusable scheduler and backpressure-pipe facades (and their
preservation tests) were removed as zero-caller dead code in backlog#1025;
scheduler buffer/priority behavior is now pinned by rustfs-io-core and
rustfs/src/storage/concurrency tests.
WorkloadClass defines the required future admission categories:
AdmissionState, WorkloadAdmissionSnapshot, and
WorkloadAdmissionRegistrySnapshot define read-only status shapes for later
runtime owners. They do not replace the current scheduler, request guard,
scanner, heal, replication, or ECStore placement behavior.
rustfs-concurrency owns this reusable contract surface.rustfs-ecstore or RustFS binary runtime
state.The RustFS storage ConcurrencyManager now implements
WorkloadAdmissionSnapshotProvider for local foreground-read admission:
ForegroundRead reports local disk-read permit usage through
GetObjectQueueSnapshot.active is the number of disk-read permits currently in use.limit is the configured maximum concurrent disk reads.queued remains None because the current semaphore does not expose waiter
counts.Unknown until their owning runtime components expose read-only status.This is an observation surface only. Permit acquisition, priority assignment, buffer sizing, storage media detection, request guards, and queue behavior are unchanged.
The RustFS integration layer now exposes a read-only repair admission snapshot from the heal runtime counters:
Repair reports the current heal active task count.queued reports the current heal queue length.limit remains None because the configured heal queue and concurrency
limits live behind the async heal manager state.Unknown in this provider until their owning
runtime components expose read-only status.This is an observation surface only. Heal request admission, queue capacity, priority merge/drop policy, task scheduling, retry handling, and repair behavior are unchanged.
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.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.
The RustFS integration layer now extends the workload admission registry with additional read-only owner mappings:
ForegroundRead reuses the storage ConcurrencyManager disk-read permit
snapshot so the RustFS-level provider exposes the same active and limit
counts as the storage-local provider.Scanner reports the existing scanner active work-unit counter. When the
counter is zero, the snapshot remains Unknown because the current counter
cannot distinguish an idle scanner from a scanner that has not initialized.Metadata reports Open once the bucket metadata runtime handle is
available, and Unknown before initialization.ForegroundWrite remains Unknown until a write-specific admission owner
exposes a read-only surface.This is an observation surface only. Disk-read permit acquisition, scanner cycle scheduling, bucket metadata loading, metadata locks, object write paths, and queue behavior are unchanged.
WorkloadAdmissionRegistrySnapshot::overlay composes provider-owned registry
snapshots without mutating runtime owners:
ForegroundRead.This keeps the later controller/status layer consuming a single read-only registry while preserving the existing storage, scanner, heal, replication, and metadata ownership boundaries.