On-Disk Layout¶
Root and Subtrees¶
Store root is
storage.local_root.Segment data is rooted under
${local_root}/segments/.Paths are derived by stable helper functions, not ad hoc string concatenation.
Stable Layout Contract¶
edge/storage/layout.go defines the canonical layout contract:
SegmentFileExt = ".seg"MetadataFileExt = ".meta"safeName(segment_id)= hex-encoded segment ID bytesshardPrefix= first two hex chars (256shard buckets)segmentPath(root,id)andmetadataPath(root,id)compute final pathssegmentsRootDir(root)computes top-level segment directory
Commit and Recovery Semantics¶
Segment commit marker is the
.metafile.A
.segwithout.metais treated as uncommitted.Recovery removes temp files and orphan pairs on startup.
Runtime storage operations (
Write,Read,Delete,Stats) use the same path helpers and extensions.
Evidence¶
edge/storage/layout.go(SegmentFileExt,MetadataFileExt,segmentPath,metadataPath,segmentsRootDir)edge/storage/localstore.go(path helper usage in write/read/delete/stats paths)edge/storage/recovery.go(recovery walk and orphan/temp cleanup)edge/storage/layout_test.goedge/storage/crash_test.go