Disk Ceiling¶
Invariant (INV-04)¶
Disk usage is checked with kernel accounting (statfs). Writes that cannot stay within the configured ceiling after eviction are rejected with ErrCeilingExceeded.
Implemented Behavior¶
Pre-write check and synchronous eviction path under lock.
Post-write check after fsync/rename sequence.
Alignment tolerance (
blockAlignTolerance = 8192) for filesystem block effects.Ceiling-guarded writes are serialized to avoid unsafe concurrent overshoot races.
Config Keys¶
storage.disk_ceiling_bytesstorage.eviction_threshold_fractioneviction.max_eviction_batch_size
Failure Injection / Tests¶
TestCeiling_ErrCeilingExceeded_PostWriteCheckTestCeiling_PreEviction_TriggeredAtThresholdFI disk tests in
edge/fi/fi_disk_test.go
Evidence¶
edge/storage/store.go(ErrCeilingExceeded,Storecontract)edge/storage/localstore.go(write protocol, tolerance, lock behavior)edge/storage/store_test.goedge/fi/fi_disk_test.godocs/_generated/test-outputs/demo-output.txt