5.5 KiB
Workload Admission Contracts
This document records the rustfs/backlog#660 PR-05 and PR-07 scheduler
preservation and runtime workload-class contract slice.
Preservation Coverage
The rustfs-concurrency tests pin the current reusable scheduler and
admission-facing behavior before later snapshot extraction:
- Worker slot over-release remains clamped by the configured worker limit.
- Scheduler default buffer and priority thresholds remain unchanged.
- Scheduler priority boundaries remain high below the high threshold, normal at both thresholds, and low above the low threshold.
- Backpressure pipe metadata reads preserve buffer capacity and state without mutating the manager state.
GetObjectQueueSnapshotpreserves saturated, over-available, and zero-total permit semantics.
Workload Class Contract
WorkloadClass defines the required future admission categories:
- Foreground read.
- Foreground write.
- Metadata.
- Scanner.
- Repair.
- Replication.
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.
Boundary Rules
rustfs-concurrencyowns this reusable contract surface.- The contract does not depend on
rustfs-ecstoreor RustFS binary runtime state. - No scheduler decision logic, queue capacity, Tokio runtime default, scanner admission, heal admission, replication admission, placement, membership, or NUMA behavior changes are part of this slice.
Set-Local Snapshot Extraction
The RustFS storage ConcurrencyManager now implements
WorkloadAdmissionSnapshotProvider for local foreground-read admission:
ForegroundReadreports local disk-read permit usage throughGetObjectQueueSnapshot.activeis the number of disk-read permits currently in use.limitis the configured maximum concurrent disk reads.queuedremainsNonebecause the current semaphore does not expose waiter counts.- Scanner, repair, replication, foreground write, and metadata entries remain
Unknownuntil 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.
Heal Repair Snapshot Extraction
The RustFS integration layer now exposes a read-only repair admission snapshot from the heal runtime counters:
Repairreports the current heal active task count.queuedreports the current heal queue length.limitremainsNonebecause the configured heal queue and concurrency limits live behind the async heal manager state.- Other workload classes remain
Unknownin 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.
Replication Snapshot Extraction
The RustFS integration layer now exposes a read-only replication admission snapshot from the existing replication pool and queue statistics:
Replicationreports active regular, large-object, and MRF worker counts.queuedreports the current site replication queue count when queue stats are immediately observable.limitremainsNonebecause 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
Unknowninstead 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.
RustFS Runtime Owner Snapshot Extraction
The RustFS integration layer now extends the workload admission registry with additional read-only owner mappings:
ForegroundReadreuses the storageConcurrencyManagerdisk-read permit snapshot so the RustFS-level provider exposes the same active and limit counts as the storage-local provider.Scannerreports the existing scanner active work-unit counter. When the counter is zero, the snapshot remainsUnknownbecause the current counter cannot distinguish an idle scanner from a scanner that has not initialized.MetadatareportsOpenonce the bucket metadata runtime handle is available, andUnknownbefore initialization.ForegroundWriteremainsUnknownuntil 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.
Provider Composition Boundary
WorkloadAdmissionRegistrySnapshot::overlay composes provider-owned registry
snapshots without mutating runtime owners:
- The storage concurrency provider remains the source of truth for
ForegroundRead. - The RustFS runtime owner provider overlays metadata, scanner, repair, replication, and foreground-write status on top of the storage registry.
- Matching workload classes are replaced by the later provider snapshot; new classes are appended without reordering existing unrelated entries.
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.