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:
+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:57:16.412Z",
|
||||
"updated_at": "2026-06-12T06:02:11.867Z",
|
||||
"session_ids": [
|
||||
"opencode:ses_145c3bae9ffeTB2zbsTym0Cev8"
|
||||
],
|
||||
@@ -107,6 +107,19 @@
|
||||
"status": "completed",
|
||||
"ended_at": "2026-06-12T05:57:16.412Z",
|
||||
"elapsed_ms": 23149
|
||||
},
|
||||
"todo:17": {
|
||||
"task_key": "todo:17",
|
||||
"task_label": "17",
|
||||
"task_title": "WAL recovery: tail truncation + main flow",
|
||||
"session_id": "opencode:ses_14597418effebiQE4kDHOCEW0E",
|
||||
"agent": "Sisyphus-Junior",
|
||||
"category": "unspecified-high",
|
||||
"updated_at": "2026-06-12T06:02:11.867Z",
|
||||
"started_at": "2026-06-12T06:01:55.154Z",
|
||||
"status": "completed",
|
||||
"ended_at": "2026-06-12T06:02:11.867Z",
|
||||
"elapsed_ms": 16713
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -114,7 +127,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:57:16.412Z",
|
||||
"updated_at": "2026-06-12T06:02:11.867Z",
|
||||
"session_ids": [
|
||||
"opencode:ses_145c3bae9ffeTB2zbsTym0Cev8"
|
||||
],
|
||||
@@ -213,6 +226,19 @@
|
||||
"status": "completed",
|
||||
"ended_at": "2026-06-12T05:57:16.412Z",
|
||||
"elapsed_ms": 23149
|
||||
},
|
||||
"todo:17": {
|
||||
"task_key": "todo:17",
|
||||
"task_label": "17",
|
||||
"task_title": "WAL recovery: tail truncation + main flow",
|
||||
"session_id": "opencode:ses_14597418effebiQE4kDHOCEW0E",
|
||||
"agent": "Sisyphus-Junior",
|
||||
"category": "unspecified-high",
|
||||
"updated_at": "2026-06-12T06:02:11.867Z",
|
||||
"started_at": "2026-06-12T06:01:55.154Z",
|
||||
"status": "completed",
|
||||
"ended_at": "2026-06-12T06:02:11.867Z",
|
||||
"elapsed_ms": 16713
|
||||
}
|
||||
},
|
||||
"agent": "atlas"
|
||||
|
||||
@@ -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`:尾部截断持久化
|
||||
|
||||
Reference in New Issue
Block a user