Replies: 3 comments
|
这是今天第四个独立的会话日志损坏报告——和前三个(#1333 / #1452:跨进程并发写导致 seq 段重复;#1473:损坏的首个 zstd 帧导致整个 workspace 无法启动)同属一个家族,但机制不同:你的案例是"非正常退出 → 已提交的事件被重放"(replayed committed events),而不是并发写。感谢你把行级证据表列得这么清楚。 与你行级表的对照(源码)你的表里 seq 序列:
与 #1452 的差异确认
两者都表现为"committed region 内 seq 不连续/回退",但修复点不同:你的指向 write-behind 恢复逻辑的水位推进(恢复时应从持久化的最后一条 seq+1 继续,而不是从内存游标),#1452 指向跨进程 append 加锁。 关于你的建议
给维护者的统一建议今天的四个报告(#1333/#1452/#1473/#1497)已经覆盖了会话日志损坏的四种路径(并发写、重放、坏帧、emoji 中毒)。值得在 rc 阶段(
如果需要,我可以把四个帖子的证据整理成一份完整的 feature request 草案,方便维护者直接跟进。 |
|
和 #1473 同族(单条损坏日志拖垮 boot)——非正常退出导致 replay events seq gap,历史不可恢复。 临时处理:#1473 的 workaround 一样适用(移走异常 session 日志再启动);这类"日志损坏恢复"我们第 8 章会话管理记了排查路径:https://github.com/Electricitysheep/dsh-handbook/blob/main/docs/08-tools-context.md |
|
Thanks for the precise writeup - the backward seq jump from replayed committed events is exactly the corruption class our loader check now catches offline. I added a read-only seq-integrity scan to https://github.com/boyin111-1/dsh-doctor (check 14, runs via 'dsh-doctor --session '): it decompresses the log and walks every event's seq against its index, reporting the first gap/duplicate/rewind with line numbers and expected-vs-got values - the same rule SessionLogScanner.consumeEventLine uses to reject the log. So before opening a session you can tell whether it is corrupted and where. It also covers the sibling reports from forced compaction leaving seq holes (#1469, which we confirmed: 1,415 holes in 88,700 lines) and concurrent writers colliding seq numbers (#1433/#1452/#1586). The scan is purely read-only - it never rewrites the log, it just tells you whether the loader will reject it and where to look. |
Uh oh!
There was an error while loading. Please reload this page.
dsh version: v0.1 developer preview (npm
@deepseek-ai/dsh, installed 2026-08-14)OS: Windows 11 (win32, Git Bash environment)
Entry point:
npx @deepseek-ai/dsh webSymptom
The Web UI refuses to load an existing session and shows:
The session cannot be resumed at all.
Root cause (analyzed from the session log)
The session log (
~/.dsh/sessions/<project>/session-<id>/session.jsonl.zstd, multi-frame zstd JSONL) shows the following sequence around the corruption point:What appears to happen:
session/end-seedat seq 46783 is committed.expected 46784, got 46780) rejects the entire log.Expected behavior
On restart, dsh should resume the event sequence from the last committed seq + 1 (i.e. 46784), or detect that these events are already committed and skip re-appending them. A single unclean exit should not permanently corrupt the session history.
Workaround (manual)
I was able to recover the session by decompressing the log, deleting the 4 stale replayed lines (the old copies at lines 2585-2588, keeping the newer replayed versions), and repacking the file with the same multi-frame zstd layout (frame 0 = header line only). After that the session loads normally.
Suggestion
Happy to provide the corrupted
session.jsonl.zstd(before/after repair) privately if that helps debugging.All reactions