Repository navigation
Description
Is there an existing issue for the same bug?
- I have checked the existing issues.
Searched open/closed issues and PRs for GetCloneTxnOperator, snapshots in the same query, different snapshot timestamps, and related prepared-query work. No dedicated duplicate was found in these searches. #31404 and #31206 concern Python SDK hint injection; this report reproduces through direct SQL with an explicit snapshot on both relations, without the SDK.
Branch Name
main (frozen S5 validation candidate; ordinary build, without the integration tag)
Commit ID
89ca3dbbf6d594d7614b8e1ca80f6b0300ed3cd2
Other Environment Information
- Hardware parameters: Linux/arm64 container, 4 CPU limit, 6 GiB memory limit.
- OS type: Linux/arm64 in Docker on an Apple Silicon host; isolated standalone LOG/TN/CN configuration.
- Others: Go 1.27.1 client;
github.com/go-sql-driver/mysqlv1.9.3. Both COM_QUERY and explicit server-sidePrepareContext/EXECUTE were exercised; no client-side parameter interpolation or prepared-statement emulation. - Ordinary MatrixOne binary SHA256:
0ae125cb624dccd50c342821cecc696d5db64a3f86d9c217fa26e0e502d4614a. - Evidence was collected on the commit above. Newer main was consulted only for issue delivery/templates, not retested here.
Actual Behavior
Two named snapshots individually return the correct historical values, but using both historical timestamps in one query within the same account silently reuses one read point. The result depends on relation order:
| Query/control | Expected | Observed |
|---|---|---|
Read t at S1 alone |
1 |
1 |
Read t at S2 alone |
2 |
2 |
t@S1 a CROSS JOIN t@S2 b |
(1,2) |
(1,1) |
Reverse: t@S2 a CROSS JOIN t@S1 b |
(2,1) |
(2,2) |
Forward JOIN with a.x=1 AND b.x=2 |
one row (1,2) |
empty |
| UNION ALL of labeled S1/S2 reads | ('a',1),('b',2) |
('a',1),('b',1) |
| Two CTEs selecting S1/S2, then JOIN | (1,2) |
(1,1) |
Different tables in the same account: t@S1 and u@S2 |
(1,22) |
(1,11) |
The minimum data-only witness has no schema mutation, View, publication, or cross-account access. This is not merely a self-join transformation or stale View-column problem.
The same temporal mismatch affects metadata consumers:
- A base column changes from
VARCHAR(8)at S1 toVARCHAR(13)at S2. Separateinformation_schema.columnsqueries return 8 and 13; a mixed JOIN returns 8/8, and reversing the relations returns 13/13. Mixed UNION also reads the wrong width. - Direct
mo_catalog.mo_columnsreads show the same mismatch, so the observation is not solely an information_schema presentation issue. - Ordinary View data reads also reproduce. In the tested combination, the View's dynamic information_schema description returns the correct 8/13 while its underlying data JOIN reads the wrong historical values.
- Text and actual binary prepared execution both reproduce the schema/data variants. Independent minimal probes and the final consolidated run retained these failures.
Impact: silent incorrect read results, including false-empty filtered queries and inconsistent historical metadata/data. Persisted-data corruption and cross-tenant unauthorized disclosure have not been demonstrated.
Expected Behavior
Each relation with an explicit named snapshot must read its own authorized snapshot timestamp, regardless of other relations, order, JOIN/UNION/CTE shape, or prepared execution. Combining independently valid snapshots must not silently replace one relation's read point with another's.
Preserve current authorization, caller identity, namespace/source-owner distinctions, snapshot scope checks, and transaction/clone ownership. Do not fix only the reported information_schema width while leaving ordinary data scans incorrect.
Steps to Reproduce
On an owned ordinary instance, connect as an authorized sys administrator. These are the data-only probe's original fixture names and SQL operations, reduced to the failing JOIN:
CREATE DATABASE claude_s5_data_times;
CREATE TABLE claude_s5_data_times.t(x INT);
INSERT INTO claude_s5_data_times.t VALUES (1);
CREATE SNAPSHOT claude_s5_dt1 FOR ACCOUNT sys;
UPDATE claude_s5_data_times.t SET x=2;
CREATE SNAPSHOT claude_s5_dt2 FOR ACCOUNT sys;
-- Independent controls return 1 and 2, respectively.
SELECT x FROM claude_s5_data_times.t {snapshot='claude_s5_dt1'};
SELECT x FROM claude_s5_data_times.t {snapshot='claude_s5_dt2'};
-- Expected (1,2); actual (1,1).
SELECT a.x,b.x
FROM claude_s5_data_times.t {snapshot='claude_s5_dt1'} a
CROSS JOIN claude_s5_data_times.t {snapshot='claude_s5_dt2'} b;
-- Expected (2,1); actual (2,2).
SELECT a.x,b.x
FROM claude_s5_data_times.t {snapshot='claude_s5_dt2'} a
CROSS JOIN claude_s5_data_times.t {snapshot='claude_s5_dt1'} b;
-- Expected one row; actual empty.
SELECT a.x,b.x
FROM claude_s5_data_times.t {snapshot='claude_s5_dt1'} a
CROSS JOIN claude_s5_data_times.t {snapshot='claude_s5_dt2'} b
WHERE a.x=1 AND b.x=2;
DROP SNAPSHOT claude_s5_dt2;
DROP SNAPSHOT claude_s5_dt1;
DROP DATABASE claude_s5_data_times;No sleeps or timing races are required. The snapshots are taken after completed DML statements. Do not replace the second snapshot with the current read point: current+history was a passing neighboring control in this validation.
Additional information
Static localization at the tested commit:
getCompileTableScanDataSourceTxn, compile.go:5653–5661 reusesGetCloneTxnOperator()when non-nil without comparing its timestamp with the current node'sScanSnapshot.TS.- Another relation-opening path, compile.go:11015–11024 has the same reuse pattern; the
collectTombstonespath also consumes this clone state. Processclone accessors hold one clone in the relevant process/dependent scope.CloneSnapshotOpassigns the requested timestamp when constructing a new clone.
This is consistent with the runtime witnesses. The complete fix still needs to trace all consumers and preserve clone lifecycle/ownership; these pointers are not a substitute for a regression test.
Controls and evidence boundaries:
- Current+history, the tested cross-account metadata namespace combinations, and a separate cross-owner data test with distinguishable historical values passed. The caller remained sys (
current_account_id()=0). Do not extrapolate this report into a proven cross-tenant permission leak. - Named diagnostic cases:
TestSweepSnapshotDataOnly,TestSweepTwoSnapshotTimes, and the same-owner/two-time cell ofTestSweepMixedSnapshotNamespace. The original SQL, exact source versions, logs, candidate/binary hashes, and terminal statuses are retained in the S5 validation archive. - Resources were explicitly cleaned; owned services exited normally. This report reuses that completed evidence rather than claiming a new execution during issue creation.
- No clean pre-fix/pre-#32328 baseline comparison was performed. Introduction/regression attribution is undetermined.
Discovered during #29440 S5 acceptance. This is separate from #32390's binary DESC/DESCRIBE parser rejection and from SDK hint-injection issues. No product fix is included in this report.
Activity
fix(compile): isolate historical snapshot transactions per scan (#32415)
XuPeng-SH commentedon Nov 9, 2026
QA 交接:#32415 已合入 main,merge SHA
7c344de94df1624c6ab18bc128730bb2704f9ca9。修复将历史事务绑定到各 relation/scan,避免同一 Process 无时间戳键的 clone 被后续不同快照复用,并保持 reader/tombstone 和 IVF reader-local 生命周期。核对完整 issue 评论(当前为空)及 PR 讨论后,没有当前适用的已验证反例或未完成开发 follow-up,交 QA 验证,不代表验收通过。验证证据来自作者及冻结版本评审:#32415 (review) 对
f70ea4fc16报告 compile/IVF normal 和 race 各 1,853 个 root tests 通过;8 项重点测试各 100 次 race 重复;实际 binary prepared/multi-CN 回归两次 race;46/46 SQL BVT 两次及 metadata comparison 46/46,已核实清理,未修复生产代码对照复现 logical timestamp 错误。评审未留下 actionable finding。这些是远端已有证据,本轮没有本地编译、SQL 或合并 SHA 实测;完整 issues integration 和全仓套件不能据此宣称通过。QA 建议按原 issue 的独立 S1/S2 控制及正反关系顺序核对完整行集:同表/异表 JOIN、过滤后的非空结果、UNION、CTE、View 数据、information_schema/mo_columns 历史宽度;覆盖真实 COM_STMT_PREPARE/EXECUTE 重复执行、交错 current read、并发/错误恢复、远端 multi-CN pipeline,以及 physical/logical timestamp、reader/tombstone/IVF 路径。复核租户/发布上下文、授权及 clone 资源归属不回退。
原报告基于
89ca3dbb,未证明持久化数据损坏或跨租户越权,也未完成引入版本归因;本次交接不扩张这些结论,不把 SDK hint injection 或 DESC/DESCRIBE parser 问题合并为本项,不自动要求 backport 到 4.2。MatrixAdventurer commentedon Nov 10, 2026
核实结论:已修复可关闭(独立 QA 验收仍未完成,见楼上交接评论)。
证据:PR #32415 已于 2026-11-09 合入 main(merge 7c344de,单 PR;交接评论确认不需 4.2 backport)。根因覆盖:混合历史快照此前复用 Process 上首个无键快照 clone,静默返回错误行与历史列元数据;修复将每次 relation 打开绑定到其请求的快照事务,reader/tombstone 保留在该事务,IVF 快照 reader-local。回归测试:新增单测回归与真实 SQL 见证在未修复版本上于报告的时间戳/结果不匹配处失败;46/46 SQL BVT 两轮(含 metadata 比对)、既有表克隆 BVT 23/23、race 100 次通过。还缺:按交接建议的独立 QA 验收未完成;全仓 CI/全量 issues 套件未声明通过。
@ck89119 请在 QA 验收确认后关闭。
本操作由LW授权的MOI智能体提交
Ariznawlll commentedon Nov 10, 2026
结论
测试通过。同一查询中不同历史快照保持各自的读取时间点,原报告中的错误行、过滤后空结果和历史列宽混用在本次 main 验证中未复现。
关键证据
main@2f6fcc772175d0c0e80ad97aac6d44360c513347。本地隔离 1 LOG/1 TN/2 CN,两个 CN 的git_version()均核对为完整 SHA。information_schema.columns历史宽度为 8/13,mo_catalog.mo_columns的历史类型不同;交错当前读为 3,未污染历史读取。真实二进制 prepared 重复执行和参数变化也得到预期行集。-race -count=3通过;真实双 CN 远端 pipeline 集成测试-race -count=3通过,每次断言远端服务实际收到 pipeline,并检查正反快照顺序和 peer coordinator。待解决点