Crash Consistency¶
Write Path (implemented)¶
LocalStore documents and implements this ordering:
pre-write ceiling check
stream to temp files (
.seg.tmp,.meta.tmp)fsync temp files
atomic rename to committed files
fsync shard directory
post-write ceiling check
If post-write check fails, committed files are deleted and ErrCeilingExceeded is returned.
Recovery¶
RunRecovery performs four passes:
remove temp files
remove orphan
.seg(no.meta)remove orphan
.meta(no.seg)index valid pairs
Guarantees¶
Partial temp artifacts are removed at startup recovery.
Committed pair is represented by both
.segand.metapresent.Recovery is local-only and idempotent.
Evidence¶
edge/storage/localstore.go(documented write protocol + implementation)edge/storage/recovery.go(RunRecovery)edge/storage/crash_test.go(partial temp/orphan recovery tests)