feat(wal): implement WAL writer with group commit and recovery batch replay
- wal/commit_queue.go: bounded buffered channel for write requests - wal/writer.go: single-goroutine main loop implementing 11-step write flow with group commit, sequence allocation, MemTable publish/abort, write-stopped - wal/recovery.go: BatchReplayer interface, ReplayBatch, ReplaySegmentFile, RecoverFromSegments with fragment reassembly and tail corruption handling - Comprehensive tests for all modules, all pass with -race
This commit is contained in:
+28
-2
@@ -8,7 +8,7 @@
|
||||
"plan_name": "phase1-wal",
|
||||
"status": "active",
|
||||
"started_at": "2026-06-12T05:09:32.588Z",
|
||||
"updated_at": "2026-06-12T05:49:50.501Z",
|
||||
"updated_at": "2026-06-12T05:57:16.412Z",
|
||||
"session_ids": [
|
||||
"opencode:ses_145c3bae9ffeTB2zbsTym0Cev8"
|
||||
],
|
||||
@@ -94,6 +94,19 @@
|
||||
"status": "completed",
|
||||
"ended_at": "2026-06-12T05:49:50.501Z",
|
||||
"elapsed_ms": 106010
|
||||
},
|
||||
"todo:13": {
|
||||
"task_key": "todo:13",
|
||||
"task_label": "13",
|
||||
"task_title": "Commit queue + WAL writer main loop",
|
||||
"session_id": "opencode:ses_1459dbbd5ffewqrKSfu5f6t38q",
|
||||
"agent": "Sisyphus-Junior",
|
||||
"category": "deep",
|
||||
"updated_at": "2026-06-12T05:57:16.412Z",
|
||||
"started_at": "2026-06-12T05:56:53.263Z",
|
||||
"status": "completed",
|
||||
"ended_at": "2026-06-12T05:57:16.412Z",
|
||||
"elapsed_ms": 23149
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -101,7 +114,7 @@
|
||||
"active_plan": "/home/dailz/workspace/src/go-kv/.omo/plans/phase1-wal.md",
|
||||
"started_at": "2026-06-12T05:09:32.588Z",
|
||||
"status": "active",
|
||||
"updated_at": "2026-06-12T05:49:50.501Z",
|
||||
"updated_at": "2026-06-12T05:57:16.412Z",
|
||||
"session_ids": [
|
||||
"opencode:ses_145c3bae9ffeTB2zbsTym0Cev8"
|
||||
],
|
||||
@@ -187,6 +200,19 @@
|
||||
"status": "completed",
|
||||
"ended_at": "2026-06-12T05:49:50.501Z",
|
||||
"elapsed_ms": 106010
|
||||
},
|
||||
"todo:13": {
|
||||
"task_key": "todo:13",
|
||||
"task_label": "13",
|
||||
"task_title": "Commit queue + WAL writer main loop",
|
||||
"session_id": "opencode:ses_1459dbbd5ffewqrKSfu5f6t38q",
|
||||
"agent": "Sisyphus-Junior",
|
||||
"category": "deep",
|
||||
"updated_at": "2026-06-12T05:57:16.412Z",
|
||||
"started_at": "2026-06-12T05:56:53.263Z",
|
||||
"status": "completed",
|
||||
"ended_at": "2026-06-12T05:57:16.412Z",
|
||||
"elapsed_ms": 23149
|
||||
}
|
||||
},
|
||||
"agent": "atlas"
|
||||
|
||||
@@ -1009,7 +1009,7 @@ Max Concurrent: 6 (Wave 1b)
|
||||
|
||||
**Commit**: YES (with Task 13)
|
||||
|
||||
- [ ] 13. Commit queue + WAL writer main loop
|
||||
- [x] 13. Commit queue + WAL writer main loop
|
||||
|
||||
**What to do**:
|
||||
- 创建 `wal/commit_queue.go`:`CommitQueue` — 写请求队列
|
||||
@@ -1233,7 +1233,7 @@ Max Concurrent: 6 (Wave 1b)
|
||||
|
||||
**Commit**: YES (with Tasks 16, 17)
|
||||
|
||||
- [ ] 16. WAL recovery: fragment collector + batch replay
|
||||
- [x] 16. WAL recovery: fragment collector + batch replay
|
||||
|
||||
**What to do**:
|
||||
- 创建 `wal/recovery.go`:恢复核心逻辑
|
||||
|
||||
Reference in New Issue
Block a user