feat(wal): implement segment rotation, recovery scanner, and record parser

- wal/segment_manager.go: segment lifecycle with rotation at batch boundaries
- wal/scanner.go: segment discovery, ordering, and continuity validation
- wal/record_parser.go: block-level physical record parsing with tail corruption detection
- Comprehensive tests for all modules, all pass with -race
This commit is contained in:
dailz
2026-06-12 13:50:03 +08:00
parent 349063968b
commit 08960a9bcf
9 changed files with 1074 additions and 4 deletions
+2 -2
View File
@@ -891,7 +891,7 @@ Max Concurrent: 6 (Wave 1b)
**Commit**: YES (with Task 11)
- Message: `feat(wal): implement segment writer with rotation`
- [ ] 11. Segment rotation + durable-ready protocol
- [x] 11. Segment rotation + durable-ready protocol
**What to do**:
- 创建 `wal/segment_manager.go`:管理 segment 的轮转和生命周期
@@ -1180,7 +1180,7 @@ Max Concurrent: 6 (Wave 1b)
**Commit**: YES
- Message: `feat(memtable): integrate arena+skiplist with publish/abort`
- [ ] 15. WAL recovery: scanner + record parser
- [x] 15. WAL recovery: scanner + record parser
**What to do**:
- 创建 `wal/scanner.go``SegmentScanner` — 从 WAL 目录扫描 segment 文件