You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: subscription tables invisible to DATA BRANCH (CREATE SNAPSHOT/DIFF report 'table does not exist') #30949
Tables in a subscription database are visible to ordinary queries and SHOW TABLES / information_schema, but are invisible to the DATA BRANCH machinery: CREATE SNAPSHOT ... FOR TABLE and DATA BRANCH DIFF on a subscription table fail with "table does not exist" / "no such table". The subscriber can read the data but cannot snapshot, diff, or branch it.
Environment
MatrixOne dev build 3a1e42b430, server reports 8.0.30-MatrixOne-v1.3.0
Reproduction
-- publisher (tenant_a): CREATE PUBLICATION pub1 DATABASE tdb ACCOUNT tenant_b;-- subscriber (tenant_b):CREATEDATABASEsub3FROM tenant_a PUBLICATION pub1;
SELECTCOUNT(*) FROMsub3.t1; -- OK: 3
SHOW TABLES FROM sub3; -- OK: t1, t2SELECT table_name FROMinformation_schema.tablesWHERE table_schema='sub3'; -- OK (t1, t2)
CREATE SNAPSHOT sp FOR TABLE sub3 t1; -- ERROR 20101: table sub3.t1 does not exist
DATA BRANCH DIFF sub3.t1 AGAINST sub3.t1; -- ERROR 1146: no such table sub3.t1
Root cause
The subscription table is resolvable through the SQL query path and the catalog (so SELECT/SHOW/information_schema work), but the DATA BRANCH snapshot/object layer resolves tables through a different path that does not see subscription tables. This is the DATA BRANCH-side residue of the same subscription-table visibility gap that #27794 reported for information_schema (now fixed there); the snapshot/branch path was not covered by that fix.
Impact
A subscriber cannot build snapshots or run DATA BRANCH DIFF/MERGE/PICK against subscribed data — a natural "branch the subscribed dataset and track changes" workflow is blocked.
Inconsistent visibility: the same table exists for reads but "does not exist" for branching, which is confusing and breaks tooling that mixes the two.
Expected behavior
Subscription tables should be resolvable by the DATA BRANCH snapshot/diff path just like locally-created tables (CREATE SNAPSHOT and DATA BRANCH DIFF should work on them), or the limitation should be a clear, documented error rather than "table does not exist".
Additional post-merge evidence: subscription CLONE loses its logical source during a planner retry.
PR #29152, exact head 9807498ef2a7c814c411490073e9217fab2c1159, failed the Linux/x64 Compose + Pessimistic BVT in run 40186991579, attempt 1, job 121151741645. publication_subscription/pub_sub_data_branch.sql:266 fails on:
data branch create table c1 fromsub3.t1;
-- SQL parser error: table tdb-t1 does not exist
The following four failures are consequences of missing c1; the next independent c2 clone succeeds. The BVT summary is 49,990 statements, 5 failed. Coverage job 121160943227 is blocked by its producer prerequisite and calculates no coverage verdict.
The uploaded CN trace identifies the trigger, rather than merely a matching filename. On cn-0 at 11:32:36.422596 UTC, compile/lifecycle_fk_scope.go:563 reports txn need retry in rc mode, def changed; the same transaction then resolves physical database tdb under subscriber account 64 and plan/build_table_clone.go:93 emits the missing-table error. Transaction: 72f65f5cca73bdec18e1c14907118e2a. Reports artifact.
buildCloneTable rewrites stmt.SrcTable from the subscription alias to the publisher's physical table. Replanning the same AST can therefore lose the subscription routing. This code, its table-clone admission path, and its relation/subscription resolver are unchanged by PR #29152; the PR's edits to clone execution concern database cloning of Python routines.
A controlled planner probe reproduces this exact mechanism on both the PR and current official main 12eeeb0205b5e87faef48660ddbcd8cb5e18baea:
Parse CREATE TABLE ldb.c1 CLONE sub3.t1; resolve the subscription to publisher tdb.t1; require the entire first BuildPlan to succeed.
Observe that the AST source now contains tdb.
Build the same AST again under subscriber identity: exact SQL parser error: table tdb-t1 does not exist.
Parse the identical original SQL afresh: the complete plan succeeds again.
Both diagnostic runs passed their positive and negative assertions (PR 0.881s, main 0.853s). Main was compiled via a read-only Go overlay in the existing task checkout: all 6,698 main Go files were byte-checked against Git, both sides of renames were handled, PR additions were hidden, and module/native inputs were unchanged. Mode: Go 1.27.1, Darwin/arm64, controlled CGo wrapper. This is a planner reproduction using exact main sources, not a separate Linux BVT replay or prior maintainer confirmation.
This identifies a B6 clone-retry residue distinct from the original snapshot/DIFF lookup gap. Preserve the logical alias across planning/retry when investigating a fix. No unrelated source changes were made in PR #29152. The same run also ended with a separate SQL integration flush timeout that is still being attributed, so no workflow rerun has been requested yet.
每轮通过订阅方的显式 DROP SNAPSHOT ... FROM <发布方> PUBLICATION ... 清理;发布方快照记录查询实际返回空集。发布、订阅库及账号也逐轮清理,无清理错误。
Unhappy Path 覆盖
向订阅表作为目标执行 DATA BRANCH MERGE、PICK,均被明确拒绝为 cannot perform ... into subscription database;拒绝后发布方 t1 仍精确为 (1,'a'),(2,'b'),(3,'c'),(4,'d'),订阅方本地源表仍精确为前三行,3/3 无部分写入。
对订阅库不存在的表创建快照得到 does not exist;发布方 catalog 中对应快照记录仍为空,3/3 无残留元数据。
白盒验证
修复涉及的订阅操作数分类、写目标拒绝、发布快照绑定、快照创建准入四项定向 Go 测试,在本次官方 main 上以 go test -race ./pkg/frontend -run '^(TestClassifySubscriptionOperandCoversVisibilityModel|TestRejectSubscriptionBranchWriteDestinationCoversC5|TestSnapshotPublicationBindingResolution|TestDoCreateSnapshotPublicationAdmission)$' -count=3 执行:ok github.com/matrixorigin/matrixone/pkg/frontend 4.209s,四项均 3/3 通过,未检出数据竞争。
Reproduction record for a transient recurrence of the same symptom in the B6 regression case this fix added:
Run/job: MatrixOne ALL CI, run 40798664858 attempt 1, job "Matrixone Compose CI execution / multi cn e2e bvt test docker compose(PROXY)" (123204520182), terminal 2026-10-29T01:47:33Z; head 8b41e39227 of PR #30988.
Observed:test/distributed/cases/publication_subscription/pub_sub_data_branch.sql failed 5/324 — all five at the same instant (01:41:28Z, con id=2, tenant_b), chain-rooted at row 266 data branch create table c1 from sub3.t1; returning SQL parser error: table tdb-t1 does not exist (the resolveBranchCloneSource parse-shaped diagnostic after a nil resolve of the publisher-side source), with rows 268/269/270/271 failing as its cascade. The jobs' remaining 50756 statements — including the same file's other 319 assertions and the full workspace-DML suites — passed in the same run.
Activity
gouhongshen commentedon Oct 24, 2026
PR #31039 is trying to fix this issue.
fix(frontend): resolve subscription tables for DATA BRANCH and snapsh…
gouhongshen commentedon Oct 25, 2026
PR #31039 has merged and is awaiting manual validation. The issue remains open.
iamlinjunhong commentedon Oct 25, 2026
Additional post-merge evidence: subscription CLONE loses its logical source during a planner retry.
PR #29152, exact head
9807498ef2a7c814c411490073e9217fab2c1159, failed the Linux/x64 Compose + Pessimistic BVT in run 40186991579, attempt 1, job 121151741645.publication_subscription/pub_sub_data_branch.sql:266fails on:The following four failures are consequences of missing
c1; the next independentc2clone succeeds. The BVT summary is 49,990 statements, 5 failed. Coverage job 121160943227 is blocked by its producer prerequisite and calculates no coverage verdict.The uploaded CN trace identifies the trigger, rather than merely a matching filename. On cn-0 at 11:32:36.422596 UTC,
compile/lifecycle_fk_scope.go:563reportstxn need retry in rc mode, def changed; the same transaction then resolves physical databasetdbunder subscriber account 64 andplan/build_table_clone.go:93emits the missing-table error. Transaction:72f65f5cca73bdec18e1c14907118e2a. Reports artifact.buildCloneTablerewritesstmt.SrcTablefrom the subscription alias to the publisher's physical table. Replanning the same AST can therefore lose the subscription routing. This code, its table-clone admission path, and its relation/subscription resolver are unchanged by PR #29152; the PR's edits to clone execution concern database cloning of Python routines.A controlled planner probe reproduces this exact mechanism on both the PR and current official main
12eeeb0205b5e87faef48660ddbcd8cb5e18baea:CREATE TABLE ldb.c1 CLONE sub3.t1; resolve the subscription to publishertdb.t1; require the entire firstBuildPlanto succeed.tdb.SQL parser error: table tdb-t1 does not exist.Both diagnostic runs passed their positive and negative assertions (PR 0.881s, main 0.853s). Main was compiled via a read-only Go overlay in the existing task checkout: all 6,698 main Go files were byte-checked against Git, both sides of renames were handled, PR additions were hidden, and module/native inputs were unchanged. Mode: Go 1.27.1, Darwin/arm64, controlled CGo wrapper. This is a planner reproduction using exact main sources, not a separate Linux BVT replay or prior maintainer confirmation.
This identifies a B6 clone-retry residue distinct from the original snapshot/DIFF lookup gap. Preserve the logical alias across planning/retry when investigating a fix. No unrelated source changes were made in PR #29152. The same run also ended with a separate SQL integration flush timeout that is still being attributed, so no workflow rerun has been requested yet.
Ariznawlll commentedon Oct 26, 2026
测试版本
matrixorigin/matrixonemain。5153053e6f2698403b425eb8c52ff06af21995d9;执行时远端main指向同一 SHA,修复 PR fix(frontend): resolve subscription tables for DATA BRANCH and snapshots #31039 的 merge commitecd2581d9d896cd071231b2dca3721986ff5753f已核实为其祖先。1 LogService + 1 TN + 1 CN,由该 SHA 编译的mo-service;SELECT git_version()返回上述完整 SHA。二进制 SHA-256:d3a72022b0c53cd2ce8eded638fd0f09f7080bb34e8395d2ffe10fe2f10f9707。原问题验证
针对 issue 中“订阅表普通查询可见,但
CREATE SNAPSHOT/DATA BRANCH DIFF报表不存在”的原始路径,建立发布方和订阅方两个独立账号,发布qa49_db(t1三行、t2一行),在订阅方建立qa49_sub。每轮均重新建账号与表、执行、销毁;连续 3/3 通过:订阅方SELECT count(*) FROM qa49_sub.t1实际为3,SHOW TABLES与information_schema.tables均实际返回t1,t2;CREATE SNAPSHOT qa49_sp FOR TABLE qa49_sub t1成功,发布方快照记录的真实归属为发布账号、qa49_db.t1;DATA BRANCH DIFF qa49_sub.t1 AGAINST qa49_sub.t1返回空结果,未再报表不存在。发布方插入(4,'d')后,以该快照对当前t1做 DIFF,实际仅返回一条INSERT,4,'d'。Happy Path 覆盖
DROP SNAPSHOT ... FROM <发布方> PUBLICATION ...清理;发布方快照记录查询实际返回空集。发布、订阅库及账号也逐轮清理,无清理错误。Unhappy Path 覆盖
DATA BRANCH MERGE、PICK,均被明确拒绝为cannot perform ... into subscription database;拒绝后发布方t1仍精确为(1,'a'),(2,'b'),(3,'c'),(4,'d'),订阅方本地源表仍精确为前三行,3/3 无部分写入。does not exist;发布方 catalog 中对应快照记录仍为空,3/3 无残留元数据。白盒验证
修复涉及的订阅操作数分类、写目标拒绝、发布快照绑定、快照创建准入四项定向 Go 测试,在本次官方 main 上以
go test -race ./pkg/frontend -run '^(TestClassifySubscriptionOperandCoversVisibilityModel|TestRejectSubscriptionBranchWriteDestinationCoversC5|TestSnapshotPublicationBindingResolution|TestDoCreateSnapshotPublicationAdmission)$' -count=3执行:ok github.com/matrixorigin/matrixone/pkg/frontend 4.209s,四项均 3/3 通过,未检出数据竞争。回归测试
公共 SQL 原路径及异常路径已加入 MOTR #278 的
issue_30949_subscription_branch.py与配对输出;定向运行 3/3 通过。该 PR 当前仍 OPEN,四项离线检查均通过;未声称 MOTR 全量运行/合入。没有向 MatrixOne 仓库新提回归 PR。测试证据
count=3, snapshot owner=q49p1/q49p2/q49p3, diff=INSERT id4, write rejection atomic;实际执行脚本保留于本地隔离测试目录。服务已正常关闭,测试端口已释放。CI Required、UT/SCA 等检查显示失败/阻断;不能据此宣称完整 CI 通过,也未运行全量 suite。原始行为的独立本地 SQL 3/3 与上述定向回归是本结论依据。测试结论
测试通过。
gouhongshen commentedon Oct 29, 2026
Reproduction record for a transient recurrence of the same symptom in the B6 regression case this fix added:
8b41e39227of PR #30988.test/distributed/cases/publication_subscription/pub_sub_data_branch.sqlfailed 5/324 — all five at the same instant (01:41:28Z, con id=2, tenant_b), chain-rooted at row 266data branch create table c1 from sub3.t1;returningSQL parser error: table tdb-t1 does not exist(theresolveBranchCloneSourceparse-shaped diagnostic after a nil resolve of the publisher-side source), with rows 268/269/270/271 failing as its cascade. The jobs' remaining 50756 statements — including the same file's other 319 assertions and the full workspace-DML suites — passed in the same run.7c75f3e07b) passed this whole PROXY job, and the only delta to the failed head is commit 8b41e39 confined topkg/vm/engine/disttaeadmission bookkeeping — none of the frontend/data-branch/subscription resolution bytes differ between the green and the red run. A single transient resolve miss during the run's compose load cascaded into the 5 statement failures; the B6 lineage regression (fix fix(frontend): resolve subscription tables for DATA BRANCH and snapshots #31039) is this issue's own coverage.fix(disttae): wait the settle's ledger retire in the r58 recovery leg
fix(disttae): bound long-transaction workspace maintenance and close …