docs/architecture/placement-repair-invariants.md
This inventory covers G-012 for rustfs/backlog#666. It records the current
object placement, readiness, lock quorum, scanner, and repair boundaries that
later scheduler or topology work must preserve.
Objects reach a set through Sets::get_disks_by_key, which calls
get_hashed_set_index on the object key:
DistributionAlgoVersion::V1 uses crc_hash(input, set_count).DistributionAlgoVersion::V2 and V3 use
sip_hash(input, set_count, format_id_bytes).Preservation rule: every object read, write, list, heal, repair, and decommission path that resolves a set for an existing object must preserve the same object key and format distribution algorithm.
Pool selection is separate from set hashing:
Boundary rule: schedulers may influence admission, worker concurrency, or buffer sizing, but they must not rewrite pool, set, or disk indexes.
Runtime readiness currently checks storage and lock health independently:
Boundary rule: readiness and lock quorum must stay set-aware. A global healthy disk count or global connected-host count is not sufficient when any individual set is below quorum.
Scanner cycles are bounded by ScannerCycleBudget:
Preservation rule: later scheduler work can change how scan cycles are admitted only if it preserves the budget reason, checkpoint reason, and child-token cancellation behavior.
Scanner and background repair work enter the heal manager through explicit admission:
Preservation rule: repair scheduling changes must keep admission outcomes observable and must not convert rejected or dropped repair work into silent success.
Any later placement or repair PR must use the following gates: