Phase 5: Storage fuzz tests + WAL entryCount fix + SSTable overflow checks + compaction sizeBytes accuracy
CI / test (push) Has been cancelled
CI / verify (push) Has been cancelled
Clients CI / build-server (push) Has been cancelled
Clients CI / test-python (push) Has been cancelled
Clients CI / test-javascript (push) Has been cancelled
Clients CI / test-nim (push) Has been cancelled
Clients CI / test-rust (push) Has been cancelled

- WAL: entryCount is now accurate after restart by counting existing entries
- LSM writeSSTable: adds uint32 overflow checks for key/value/entry counts
- Compaction: sizeBytes now uses actual file size instead of rough guess
- Fuzz tests: 14 new tests covering WAL truncation, LSM put/get/delete,
  recovery, scan, overwrites, SSTable roundtrip, corruption, tombstones
This commit is contained in:
2026-05-18 12:34:26 +03:00
parent 3f29c519d4
commit 132e8c7a31
4 changed files with 326 additions and 5 deletions
+4 -1
View File
@@ -107,13 +107,16 @@ proc compact*(cs: CompactionStrategy, level: int): CompactionResult =
let outputPath = cs.dataDir / "sstables" / ("level_" & $level & "_" & $tables[0].createdAt & ".sst")
var sst = writeSSTable(final, outputPath, level + 1)
# Use actual file size instead of rough guess
let actualSize = try: getFileSize(outputPath) except: final.len * 64
let outputMeta = SSTableMeta(
path: outputPath,
level: level + 1,
minKey: sst.minKey,
maxKey: sst.maxKey,
entryCount: final.len,
sizeBytes: final.len * 64,
sizeBytes: actualSize,
createdAt: tables[^1].createdAt,
)