Repository navigation
[PR] fix: fork 会话从父会话继承完整账本位置,克隆不再被跳过(#5043) - #5045
ranxianglei wants to merge 1 commit into
Conversation
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.6650-pr.5045.af4b4afThis exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr5045.tgz
npm install -g packageInstall instructions are refreshed on each push. |
|
(ai: anthropic/claude-opus-4-8) Closed as superseded: per the owner, the canonical vehicle for this fix is #5044 - kuviki's original patch (authorship and commit preserved, with a Co-Authored-By credit added), now rebased onto current master (head 4bf931c, base retargeted to master) so the full CI matrix runs directly on his PR. The patch in this mirror was byte-for-byte identical to that work (clean cherry-pick, zero diff). No content is lost by closing it - the verification evidence (baseline RED repro + full storage-lane suite results) stands via the comment on #5044. |
[bot] (ai: vllm-qwen/qwen3.8-27b) 状态汇报(进程因 35 分钟无输出被强制重启,现已恢复): 无待办。 本线程自关闭后没有任何新的人类评论或新的 CI 状态——floor 3 起全部是系统级进程状态消息,不是新工作项。 状态核实(git 实测,非转述):
此前本线程的连续重启均为进程层面挂起(线程内无新输入触发任何实际工作),不是修复本身出现了新问题。无需进一步动作,此条仅作恢复后的收尾确认。 |
(ai: anthropic/claude-opus-4-8)
贡献署名:本 PR 的修复提交为 @kuviki 原创(见其 issue #5043 与 PR #5044),此处原样 cherry-pick(commit message 含 Co-authored-by 与来源引用)。#5044 面向 #4982 release 分支,受 CI 触发规则限制(该 base 上 test-matrix 全部跳过、version-guard 结构性红);经 maintainer 决定,以本 PR 承载同一补丁在 master 上获得完整的远端全量矩阵裁决。两者内容逐字节相同:谁先合入,另一个即失去意义可关闭。
现象与后果
plugin fork(分叉会话)功能下,fork 出的子会话的"消息账本位置"来自父会话,但统一存储里子会话的行却被从第 0 位重新排起——只要父会话存在已退役的历史位(tombstone,本次发版引入的功能),两边的位置就会错位:存储把子会话误判成"已经有自己的行",直接跳过从父会话克隆原始行,导致子会话继承错误的位置映射,最坏情况覆盖压制仍在生效的消息。发布前回归审查判定 🔴 MAJOR:#4982 审查评论。
根本原因
fork 处理器先把子的快照落库(
publishForkSession→ 同步 flush,子的行按 0..N 排好),之后才执行"保持父位置的行克隆";而克隆的幂等守卫看到子已有行就整体跳过。克隆排在写入之后 = 生产路径上永远克隆不到东西(测试恰好锁的是"先克隆后写入"的非生产顺序,所以此前一直绿)。次生隐患:血缘字段(parent_session_id/fork_point_seq)的 upsert 无条件覆盖,重放/崩溃补写会改写已确立的分叉对。修法(与 #5044 相同)
[0,3,4]完整传入子会话)、崩溃重启同 key 重放、事务失败绝不发布、mysql 连接契约、媒体引用计数不变量。验证证据
b0b0e66f)上失败,失败形态正是上述 MAJOR(父[0,3,4]→ 子密排[0,1,2]);tests/issue3157-persist-durability.test.ts(隔离测试)在未改动的 master 上同样失败,与本补丁无关(Node 版本差异),单独跟进,不作为本 PR 证据。不涉及版本号、配置面、wire 协议改动;纯
fix:+ 回归测试。Fixes #5043