feat(wal): implement recovery orchestrator with tail truncation

- wal/recover.go: top-level Recover() function that orchestrates scan + replay + truncation
  Reads MANIFEST/CURRENT for recovery segment ID, handles tail corruption by truncating
- Comprehensive tests for empty dir, full flow, tail corruption, and MANIFEST updates
- All tests pass with -race
This commit is contained in:
dailz
2026-06-12 14:02:19 +08:00
parent fe2d4fc5f0
commit 294ab9181f
4 changed files with 392 additions and 3 deletions
+1 -1
View File
@@ -1287,7 +1287,7 @@ Max Concurrent: 6 (Wave 1b)
**Commit**: YES (with Tasks 15, 17)
- [ ] 17. WAL recovery: tail truncation + main flow
- [x] 17. WAL recovery: tail truncation + main flow
**What to do**:
- 创建 `wal/truncation.go`:尾部截断持久化