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_bytes

  • storage.eviction_threshold_fraction

  • eviction.max_eviction_batch_size

Failure Injection / Tests

  • TestCeiling_ErrCeilingExceeded_PostWriteCheck

  • TestCeiling_PreEviction_TriggeredAtThreshold

  • FI disk tests in edge/fi/fi_disk_test.go

Evidence

  • edge/storage/store.go (ErrCeilingExceeded, Store contract)

  • edge/storage/localstore.go (write protocol, tolerance, lock behavior)

  • edge/storage/store_test.go

  • edge/fi/fi_disk_test.go

  • docs/_generated/test-outputs/demo-output.txt

See Also