Repository navigation
[PR] fix: storage boot line states the actual selection and writer state (#7408) - #7409
ranxianglei wants to merge 1 commit into
Conversation
… writer state (#7408) The pre-#6480 wording ("storage.unified=full or BILI_STORAGE_UNIFIED=full: ... legacy files keep being written — unset the knob to roll back") survived the pure-sqlite default flip. Under the default posture — no knob set, JSON envelopes NOT written — all three clauses were false, contradicting the accurate jsonWriter-off line persist.ts prints in the same boot and steering field diagnosis into chasing a non-existent dual-write (#7408 §3b). The line now branches on the raw selection (unifiedSelectionIsSqlite) and the effective writer state (effectiveJsonWriterOff, which at that point equals persist.ts's jsonWriterOff: mode is full, backend is sqlite, and an encryption-blocked open never reaches the line): - writer off → "index.db is the load path AND the only persistent copy — JSON envelopes are not written; restore dual-write with storage.jsonWriter=on" - writer on + pure-sqlite selection → names the explicit storage.jsonWriter=on as the reason envelopes are written - writer on + explicit full → the historical dual-write wording, unchanged maybeOpen/openAsync take the file-tier jsonWriter value as a new optional parameter (persist.ts passes fileStorageJsonWriter() at both call sites); the module doc header is updated to the four current postures. Regression test: tests/issue7408-storage-boot-log.test.ts pins the exact boot line for all five reachable postures. Log wording only — no wire, config, or storage-semantics change.
(ai: vllm-qwen/qwen3.8-27b) 查重: 不重复 — no other open PR targets the storage boot line / the #7408 §3b finding. Scanned all open Labels: source issue #7408 already carries Verification (this is a completed
One non-blocking observation: the new 结构化八问
判定:代码审核通过、定向测试绿、typecheck 干净、无回归面;待 CI 全量绿即可合并。CI 收尾后我再补一条最终结果。 |
(ai: vllm-qwen/qwen3.8-27b) CI 全量绿 — pushed head 最终判定:可合并。 代码审核通过、定向测试绿、typecheck 干净、CI 全量绿、无回归面。这是一条纯日志措辞修复(启动行现在说实际的 selection 与 writer 状态),不触碰 wire/config/存储语义。合并权在你。 |
What
The full-mode
[storage]boot line insrc/storage/shadow.tsstill carried the pre-#6480 wording:Since #6480 flipped the default to pure-sqlite,
resolveStorageMode()resolves to"full"with no knob set and the JSON envelope writer defaults off — so under the default posture (the one every stock install boots into) all three clauses were false: no such knob was set, legacy files are NOT written, and there is no knob to unset. In the same boot,src/persist.tsprints the accurate linejson envelope writer off (pure-sqlite default — index.db is the only persistent copy; ...), so the two lines directly contradicted each other. Field impact (reported in #7408 §3b): the stale line steered diagnosis into chasing a non-existent dual-write.Fix
The line now branches on the raw selection (
unifiedSelectionIsSqlite) and the effective writer state (effectiveJsonWriterOff— at that point inmaybeOpenthis equalspersist.ts'sjsonWriterOff: mode is full, backend is sqlite, and an encryption-blocked open never reaches the line):…(pure-sqlite selection (storage.unified absent or =sqlite)): index.db is the load path AND the only persistent copy — JSON envelopes are not written; restore dual-write with storage.jsonWriter=onfull(writer on)…legacy files keep being written — unset the knob to roll backjsonWriter=on…legacy files keep being written — remove the explicit storage.jsonWriter=on to return to the pure-sqlite defaultfull+ explicitjsonWriter=offPlumbing:
maybeOpen/openAsynctake the file-tier jsonWriter value as a new optional parameter;persist.tspassesfileStorageJsonWriter()at both call sites (constructor + #5188 reopen). The module doc header is updated to the four current postures.Behavior change disclosure (log wording only)
unified FULL mode ENABLED (storage.unified=full or BILI_STORAGE_UNIFIED=full): … legacy files keep being written — unset the knob to roll backunified FULL mode ENABLED (pure-sqlite selection (storage.unified absent or =sqlite)): index.db is the load path AND the only persistent copy — JSON envelopes are not written; restore dual-write with storage.jsonWriter=onfullboots print the exact old string as before (pinned by the new test).Tests
tests/issue7408-storage-boot-log.test.ts— pins the exact boot line for all five reachable postures (default, explicit full, explicit jsonWriter=on env tier, explicit full + jsonWriter=off, file tier through the new parameter).issue5046-second-writer-degrade+issue4341-early-twin-adoption+issue5188-sidecar-recoverable-open+storage-unified+storage-json-writer-off*+storage-mode-label(48 tests). Full-suite verdict = CI on the pushed head.Addresses the §3b finding reported in #7408 (the datapoint's other findings are folded into their existing boards — #5796, #7254, the #5744/#5756 residual thread #6169, and #7382 — via comments on those threads). Per the owner's 2026-11-20 directive, #7408 is folded into the root-cause aggregation issue #7413 and stays OPEN for batch closure after fix verification — so this PR deliberately carries no auto-close keyword (close/fix/resolve) for #7408.