Repository navigation
Description
Existing reports
Related to #32500 and #33043. This case starts with a committed source object and a committed delete. The source stays correct, while the clone resurrects the already deleted row after a separate DELETE. The same result occurs before and after #33043. #29540 concerns a snapshot advance and RowID transfer during an active transaction.
Environment
Reproduced on Linux x86_64 with two CNs, one TN, and a local disk-backed isolated cluster.
4.2-devrelease candidate6c05e42f9f660a207077b050b8ec285ccf3f8103- Parent of [4.2-dev] fix(disttae): isolate clone deletes by logical table #33043,
310089e57a - Published binary
v4.2.8-hotfix-20261119,5c16f56639acfc07ded01831c49c9bdec8e61125
Reproduction
Run the following in one session connected to the first CN. All rows are synthetic.
CREATE DATABASE clone_delete_reappears;
USE clone_delete_reappears;
CREATE TABLE src (id INT PRIMARY KEY, a INT);
INSERT INTO src VALUES (1,11), (2,22), (3,33), (4,44);
SELECT mo_ctl('dn','flush','clone_delete_reappears.src');
DELETE FROM src WHERE id=2;
SELECT mo_ctl('dn','flush','clone_delete_reappears.src');
SELECT id FROM src ORDER BY id;
BEGIN;
CREATE TABLE copy_t CLONE src;
SELECT id FROM copy_t ORDER BY id;
DELETE FROM copy_t WHERE id=3;
SELECT id FROM src ORDER BY id;
SELECT id FROM copy_t ORDER BY id;
COMMIT;Then query the source and clone on both CNs after the commit.
SELECT id FROM clone_delete_reappears.src ORDER BY id;
SELECT id FROM clone_delete_reappears.copy_t ORDER BY id;Expected and actual
| Checkpoint | Expected IDs | Observed IDs |
|---|---|---|
| Source after deleting 2, including after flush | 1, 3, 4 | 1, 3, 4 |
| Clone just after CREATE TABLE CLONE | 1, 3, 4 | 1, 3, 4 |
| Clone after deleting 3 inside the transaction | 1, 4 | 1, 2, 4 |
| Clone after commit on either CN | 1, 4 | 1, 2, 4 |
| Source after commit on either CN | 1, 3, 4 | 1, 3, 4 |
The source DELETE reports one affected row. The second DELETE targets only id=3 in the clone. No concurrent SQL, secondary index, or same-transaction creation of the source is needed. Four of five locally checked variants produced the same wrong result, including with a secondary index and when cloning an already cloned table. The variant without a source flush before the first DELETE returned the correct result in this fixture.
Investigation and acceptance
The visible change occurs during the first DELETE against the newly cloned table. Check whether rewriting a shared persisted object applies all inherited tombstones when copying the retained rows. The output alone does not establish the internal failure point.
Add a regression that asserts the full row sets before and after the clone DELETE, at commit, and from another CN. Retain #33043's sibling isolation and rollback coverage.
Activity
[4.2-dev] fix(disttae): preserve inherited deletes when rewriting clo…
fix(disttae): preserve inherited deletes when rewriting cloned objects (
XuPeng-SH commentedon Nov 28, 2026
转 QA:修复已分别合入
main@7a6ed59a08632decebde05ce90ac4d85e872e553(#33405)及4.2-dev@785b8ae8731b7765362ac4b4952ee1ee0b416baf(#33406)。两条线都在重写克隆对象时应用从源表继承的删除,避免已删除行因换 RowID 重新可见。合并前验证:main 的双 CN SQL 回归在恢复旧实现后两侧均复现问题,修复后两侧均通过,mo-tester 59 条通过;4.2-dev 的双 CN 回归及回滚相关定向测试通过,mo-tester 68 条通过,无忽略。main 评审后的分支更新未改 Clone 实现或回归文件。这些是合并前的证据,本轮没有独立运行两个合并后的构建或发布镜像。
QA 范围:两条线分别核对源表已提交并 flush 删除后,在同一事务内 CLONE 和 DELETE;提交前后以及另一 CN 读到提交后,源表应为
[1, 3, 4]、克隆表应为[1, 4]。同时保留二级索引、二次克隆、兄弟克隆隔离和失败回滚边界。Ariznawlll commentedon Nov 28, 2026
结论
测试通过。main与4.2-dev分别完成原始CLONE删除复活复现及必要扩展,本地和两条分支对应Linux MOTR/白盒均通过;回归已分别提交MOTR main与4.2-dev,按授权关闭。
关键证据
修复与实际运行版本
7a6ed59a08632decebde05ce90ac4d85e872e553;本地官方冻结3cb7a5e4a93dc5bd85e0fb107e558a07df934693。785b8ae8731b7765362ac4b4952ee1ee0b416baf;本地官方ea874f3f23cb14f2856d092c87d3c80cba117a97。原始复现步骤及每个观察点
每轮新建隔离数据库:
实测两个分支每轮均为:
(1,11),(3,33),(4,44)(1,11),(3,33),(4,44)(1,11),(4,44)(1,11),(4,44)(1,11),(3,33),(4,44)原缺陷中的 id=2 没有复活。每处均核对完整主键及 a 值,不只 COUNT(*)。
扩展和失败后的状态
每轮四种来源状态:首批flush+删除flush、同条件加二级索引、无首批flush、首批flush但删除尚未flush。每条线三轮,共12组;默认和二级索引路径分别核对:
(1,11),(4,44),没有幽灵索引行。(4,44);上代CLONE和源表均保持正确。(5,55),(1,999)的重复主键混合INSERT返回1062,目标仍只有1/4,id=5没有部分写入。4.2最初在缺表断言使用了main的1146,实得1064
table ... does not exist。随后用同分支普通不存在表作为对照确认既有错误契约,再按分支准确核对错误码及exist消息并重跑完整三轮。它证明ROLLBACK表确实消失,不属于CLONE修复失败;未把原失败日志抹掉或接受任意错误。实际回归和白盒
total=3 success=3 failed=0 skipped=0,13.19秒;4.2同样3/3,12.99秒。issue_32500_clone_isolation与issue_32500_clone_ownership邻接回归各三次,合计6/6、171条SQL通过;只是关联回归,不改变其他未分配Issue状态。TestWorkspaceRewriteTombstoneOffsets、TestCloneDeleteOwnershipAfterCommitTwoCN各3/3;后者通过两个真实MySQL连接和commitTS/logtail fence核对writer/reader两CN提交后读取。TestWorkspaceRewriteTombstoneOffsets、TestCloneRewriteFailureRequiresFullRollback、TestCloneRewriteKeepsPersistedDeletesAcrossCNs各3/3。回归分别追加现有 MOTR main #374 与 MOTR4.2-dev #353,脚本/golden显式分支;4.2加入已有branch-owned daily action,需相关PR合入才实际每日执行。没有往MatrixOne主库提PR。本地975/975、948/948离线工具检查及actionlint/diff均通过。
两条分支最终Linux结果
679c314000edc9ca7ef55cc90905a87f44ad2669ea874f3f23cb14f2856d092c87d3c80cba117a9707c0f301b204722f56a80704c03a2eec720627b8:Verify clone delete ownership and inherited tombstones与Verify GeoJSON COPY role and branch recovery unit contracts均SUCCESS。该step强制匹配9/9 SQL及每根3个PASS,版本由真实双CN核对。61a6d247643f9fa1dd01fa59f58b0bef18158c70,branch-owned composite整体SUCCESS,包含本单MOTR3/3及三个白盒根各3/3。该job普通MOTR服务是单CN;跨CN由既有嵌入式真实MySQL集成核对,另有前述本地两个独立进程的完整三轮,不将其拓扑混写成Linux普通MOTR的独立双进程。待解决点
本单无未通过项、无未验收项。相关MOTR PR尚待合入,用户已授权验收通过并提交回归后先关闭,稍后自行合入。
最终结论:测试通过。main与4.2-dev均未再出现已删id=2复活;完整行集、二级索引、二次/兄弟CLONE、重复写入原子性及新旧CLONE回滚均通过,两个分支对应Linux SQL和白盒门槛全部通过。未通过项:无;未验收项:无。回归已分别提交MOTR main #374与4.2-dev #353,按授权关闭。