mirror of
https://github.com/rustfs/rustfs.git
synced 2026-07-27 00:38:16 +00:00
ddb9d8ca3e
fix(object-capacity): harden clock handling in write window, background intervals and scope registry Three low-severity robustness gaps (S32+S33+#35): - WriteRecord keyed its 60-bucket write window by wall-clock unix seconds while the debounce used Instant. An NTP step backwards marked recent buckets as future and silently suppressed write-triggered refreshes until the wall clock caught up; a forward step aged the whole window at once. Bucket keys now derive from a monotonic per-record epoch, immune to clock steps. - Background refresh/metrics intervals were only clamped at zero; RUSTFS_CAPACITY_SCHEDULED_INTERVAL=u64::MAX overflowed Instant + Duration and panicked the spawned task, silently killing scheduled refreshes. Intervals now clamp into [1s, 30 days] via one helper with a structured warn. - record_capacity_scope merged new disks into an expired entry and refreshed its recorded_at, resurrecting a scope take_capacity_scope would have discarded (and the merge path never pruned). Expired entries are now replaced, not merged into. Ref: rustfs/backlog#1022 (S32+S33+#35 from audit rustfs/backlog#1010)