Repository navigation
[PR] fix(#4506): release media refs on historian retire + budget the #3250 custom-cap slack (#4390 follow-ups) - #4511
Merged
Conversation
Contributor
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.5431-pr.4511.3f98c39This exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr4511.tgz
npm install -g packageInstall instructions are refreshed on each push. |
Contributor
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.796-master.fa81aa2 # this exact build
npm install -g billion-context@master # always the newest merged build
|
This was referenced Oct 24, 2026
Closed
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
根因(bisect 铁证)
git bisect f161c518..02f544da→ first bad commit = f013414(#4390 row-identity-historian,PR #4395)。两个破口:破口 1:媒体引用泄漏(media-cas 家族,windows 分片稳定红)
#4390 把权威集清扫从「DELETE+释放引用」改成「retired_at 墓碑」。文本字节保留是评审过的史官语义,但 retired 行的
message_media映射与媒体 CAS 引用也永远不释放了(默认要等 archive 365 天)——图片重度会话里就是 #3762/#3901 说的「字节永久泄漏」。#4395 验证时漏跑了 media-cas 家族,滑过去了。修法:retire 时删除该行的媒体映射并释放 CAS 引用(文本字节照旧史官保留);rewind-redo 复活时由重摄取的幂等 upsert 重建映射+引用(
INSERT OR IGNORE+ release-on-no-change,普通重摄取净零)。sqlite + mysql 双后端同款。破口 2:#3250 custom-cap 断言的一页余量(#4506 主签名,全平台)
断言
journal_size_limit=1MiB截断后 WAL ≤ cap+4KiB(一页余量)。#4390 给每行加了 identity 列(64 hex)+idx_messages_identity索引项 ≈ +250B WAL 帧/行,~192 行 → 超 12 页(实测 1095952 vs 1048576)。截断不变量本身完好(autocheckpoint 照常截到 cap),坏的是「最后一次截断后到断言之间的新累积帧」超了页级预算。修法:custom-cap 用例改用 64KiB 的 inter-reset 累积预算(注释引用 #4390 行体积);
close-converges等其余断言维持一页余量不变。验证
media-cas3/3(含新增 rewind-redo 复活重建映射断言)、issue3250-wal-checkpoint5/5npm run typecheck0 错;无新配置/无 schema 变更(kernel-change: none)Closes #4506