Repository navigation
fix: reject mixed-generation ordinary dataset query results - #261
Conversation
|
Latest-head CI verification (2026-10-11): commit |
Retain reviewed differential steps, all platform partitions and the unconditional generation guard. Query-service union matches independently reviewed combined runtime.
|
已按授权顺序与 #258 后的 main 仅共享 CI 基础出现上下文冲突;保留当前 main 的 differential step/evidence 和平台分片。查询服务自动合并同时保留 zero-rank completeness 与无条件世代防护,最终 query_service.py 字节与此前独立审阅的组合运行时完全一致。原 #261 的并发/变更/信号用例保留,双语说明合并。 实际当前集成树 129 项定向检查通过,覆盖 provenance、concurrency、mutation、signal、zero-rank、differential runner/CI、platform、governance。远端新树与该验证树相同;新 head 的完整托管 Test/Platform CI 待验证。SIGTERM/SIGKILL 残留仍是明确记录的限制,本次不新增清理行为、不关闭 #252。 |
Depends on #255; infrastructure ancestry is included. This PR intentionally leaves #252 open because its signal-cleanup requirements remain unresolved.
Summary
Refs #252. This change covers deterministic concurrent readers and interruption boundaries, and fixes the mixed-generation query-result bug uncovered by the mutation acceptance tests.
Bug reproduction and fix
Previously, an event query paused after first-shard hydration could return old
allocatedvalues for IDs 0–9 and values increased by 10,000 for IDs 10–79, without an integrity error. A count-only query could likewise combine counts from different generations.QueryServiceonly applied its final guard to an internal_resolvedreport path.The focused fix makes that existing guard unconditional for dataset queries. The deterministic mid-query mutations now raise
DatabaseSchemaError; JSON CLI exits 1 withDATABASE_SCHEMA_INVALID, no stdout and no partial rows/counts. Unchanged queries retain their complete expected results.This guard is change detection, not an atomic filesystem snapshot. The tests do not prove every change-and-restore race impossible. Existing strong/immutable assumptions remain in force.
Cost and signal limitations
Default verification adds one complete manifest/member hash pass to ordinary dataset queries. On the 8-member, 80-event compatibility-v1 fixture, the added pass is 9 hash calls / 132,113 bytes. Total cold/warm query counts are 27 / 18 calls and 396,339 / 264,226 bytes. Explicit POSIX immutable mode adds zero final hash scans; cold admission is 10 calls / 133,154 bytes, warm zero. No wall-time or RSS threshold is claimed.
Observed current signal behavior after a real insert:
pt-snap-lifecycle-*directory andderived.dbremain.The last two cases are passing characterization of an unresolved limitation, not acceptance of #252's requested no-residue kill behavior. Test teardown is never counted as product cleanup. A SIGTERM handling contract and any out-of-process/startup reclamation policy for SIGKILL require a separate decision and implementation.
Verification
31acd7c, byte-identical to this final branch, passed the regular suite: 2640 passed, 14 skipped, 13 slow deselected in 333.00 seconds. The 14 skips are 12 existing browser cases (Chromium unavailable) and 2 intentionally unsupported slice-leak cases; none of the original 33 new cases skipped on this Linux run. The regular suite was not redundantly repeated for the additive reviewed-infra union and test/docs-only portability follow-up.git diff --check: passed.68d89670(tree identical to localfe86fcff). Its compatibility/full/nightly separation is retained.No live user snapshot, paid model, Mac execution, or external publication was used.
Commits
ffd43e6— concurrency and signal-boundary acceptance (byte-equivalent cherry-pick ofed06735).d63aa1a— ordinary-query generation guard and regressions (byte-equivalent cherry-pick of31acd7c).78e3e31— platform-correct immutable hash accounting and deterministic non-POSIX regression; tests/docs only.Publication base:
68d89670; final head:78e3e317829a47b1b66c9d6b06ad84aed38827aa.This PR leaves #252 open because the SIGTERM/SIGKILL cleanup policy remains unresolved.
Independent final review approved tree
b65254fe5db5b3ff1fb44618f7959b06c7a4986b: 127 integration-focused tests passed; earlier runtime review passed 296 tests and 8 extra hidden-metadata/native/compatibility probes. All runtime source is byte-identical to the reviewed guard fix. Remote CI is pending.