A second failed update rollback restores a stale -wal from an earlier failed rollback
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 78/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- sqlite, typescript
调研方向
从src/updater/index.ts中的backupDatabases和restoreDatabases开始,然后阅读src/updater/AGENTS.md中的第 5 步,了解备份文件夹的生命周期。检查 updater 测试是否覆盖备份和回滚,并运行相关测试。完成标准是:回滚只恢复该次更新创建备份时已存在的 sidecar 文件,即使之前的回滚失败过也是如此。
由索引模型根据 Issue 内容生成。
描述
An update whose new daemon fails to start can restore a stale SQLite -wal file next to a newer database, when an earlier update's rollback had also failed.
backupDatabases (src/updater/index.ts:159) creates update-backup with mkdirp and copies only the sidecar files that exist now; it never removes ones already in the folder. restoreDatabases (:172) copies back every sidecar it finds there. The folder is deleted after a good start or a good rollback, so it survives only after a rollback that failed (src/updater/AGENTS.md, step 5). A clean daemon stop leaves no -wal, so the old -wal from that earlier attempt stays in the backup, and the second rollback puts it beside the current state.db. SQLite may then replay or reject a WAL that does not belong to that database, so the restored state can be wrong or the database unreadable.
Steps. (1) An update whose start fails and whose rollback also fails, leaving update-backup with a -wal. (2) A clean stop. (3) A second update whose new daemon fails to start, so it rolls back. The live state.db-wal is now the one from step 1.
Expected. A rollback restores exactly the files that existed when that update's backup was taken.
Possible fix. Empty (or remove) update-backup at the start of backupDatabases.
Found in a code review, checked by hand.
Written by an agent.
- 主要语言
- TypeScript
- 星标
- 535
- 派生
- 21
- 平均合并
- 9 小时 26 分钟
- 30 天内合并 PR
- 437
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
callstackincubator/simlock 的其他 Issue
-
bug:new
难度 2/5 1-3 小时 新手友好度 76/100
callstackincubator/simlock#1229 · 2 条评论 ·
维护者通常 1 天内回复
-
os:windows request:new
难度 2/5 1-3 小时 新手友好度 70/100
callstackincubator/simlock#1071 ·
维护者通常 1 天内回复
-
Choose iOS slim categories per lease, and re-sync slim-labels.ts with simslim's new mdm category未关闭
难度 5/5 一周以上 新手友好度 45/100
callstackincubator/simlock#1244 ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 35/100
callstackincubator/simlock#1242 ·
维护者通常 1 天内回复
-
A lease's label is its device's window title: lease --label可能已有人在做 @xavi-999 今天认领。 未关闭
难度 4/5 3-5 天 新手友好度 30/100
callstackincubator/simlock#1240 · 1 条评论 ·
维护者通常 1 天内回复
查看 callstackincubator/simlock 的全部 Issue
相似的 Issue
-
needs investigation
难度 2/5 1-3 小时 新手友好度 60/100
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
area:visualizer tech-debt
难度 2/5 1 小时以内 新手友好度 66/100
jmbarzee/temporal-architect#292 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100
riverqueue/river#1576 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
colbymchenry/codegraph#3228 ·
维护者通常 1 天内回复