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]: [4.2-dev] Named publication grants can block DROP ACCOUNT for an unrelated account #32986
4.2-dev at 53b3bc7c95c500de89a60001d947001c5d77d958, which includes #32937. Reproduced on two local CNs and one TN using the MySQL protocol.
Customer-visible behavior
An administrator changing a publication with a named recipient list can delay another administrator deleting an account outside the list. The second DDL waits on mo_catalog.mo_account until the publication transaction ends. The observed impact is DDL availability.
CN row-lock threshold
Named recipients
Does an unrelated DROP wait on mo_account?
16
1
Yes
16
17, with an unrelated ID between named IDs
Yes
20,000 (default), same small catalog
1 or 17
No
Reproduction and expected result
Configure the two test CNs with max-row-lock-count = 16. Create a source database, a publication and named recipient accounts. Create an additional account outside the publication.
Hold the publication row in an explicit SQL transaction. On the other CN, run ALTER PUBLICATION ... ACCOUNT .... Wait until the ALTER is queued on mo_pubs, after it has resolved and locked its recipient set.
The unrelated DROP should complete independently. Dropping an actual recipient must serialize with the grant, and the deleted ID must have zero grants when both statements finish.
Cause and scope
#32937 correctly pins subscriber IDs to prevent a stale grant after deletion. The new locking SELECT can become table-level when the planner's estimated row count exceeds the threshold. The 4.2 single-account locking read and final catalog DELETE also have lock-planning paths that can widen the conflict. Production frequency at the default threshold on larger catalogs has not been measured. The ACCOUNT ALL/new-account race is tracked separately in #32941.
Activity
[4.2-dev] fix(pubsub): keep named publication grants on exact account…
XuPeng-SH commentedon Nov 26, 2026
#32987 已合入
4.2-dev(376853498154aa054bef72bf0878f71e4fc154f8),转 QA;此处不表示 QA 验收已通过。作者记录两个 CN + 一个 TN、真实 MySQL、锁阈值 16 下的对照:1/17 个命名接收方时,无关 DROP 可独立完成,命中接收方的 DROP 仍正确等待,删除后旧 ID 无 grant;旧生产文件恢复后宽用例在 30 秒截止处失败。作者另外验证了阈值 1 下 DROP/RESTORE、代理锁跨 CN、129 个接收方以及 optimistic 与回滚相关路径。本轮未独立执行。
建议在合入版本确认上述并发时序、精确授权和同名重建不继承旧 grant;补默认阈值下的大 catalog 及混合负载,混合版本未测。ACCOUNT ALL 的独立新账号竞态仍由 #32941 跟踪,不纳入本单验收。
Ariznawlll commentedon Nov 29, 2026
结论
测试不通过,失败范围限定为 4.2-dev、受限发布 CN、129 个命名接收方 的扩展场景。原问题的 1/17 接收方锁范围符合预期,但不能据此外推更宽的授权列表通过。本次不关闭、不转派。
关键证据
版本与隔离环境
2bdc8daf527846ace58ab465c33127d02174e83b,包含修复 [4.2-dev] fix(pubsub): keep named publication grants on exact account rows #32987,merge SHA376853498154aa054bef72bf0878f71e4fc154f8。mo-service进程,单 TN/LogService,真实 MySQL 协议;两个 SQL 入口逐轮核对git_version()完整 SHA。这是明确的低预算扩展,不能推断默认配置全部失败。所有账号、数据库、publication 使用本轮独立前缀,结束后已清理,两台自建 CN 进程已退出,未影响其他实例。
原始锁范围和恢复控制
以下已有集成根测试各执行 3 次,12/12 通过:
覆盖:阈值 16 下 1/17 个接收方,ALTER 实际等在 mo_pubs 时,无关 DROP 独立完成;真正接收方 DROP 仍等待,删除后旧 ID 不残留授权;阈值 1 的删除和恢复;跨 CN 代理锁恢复。创建发布的官方根测试实际是 17 个接收方(16+1),不是 129 个。 该测试从两个锁键分段删除接收方后剩余授权精确为 15。上述集成 CN 是测试进程中的服务实例;下面 129 扩展则使用独立服务进程,不混写两种环境。
129 个接收方复现步骤
每轮执行:
CREATE PUBLICATION ... DATABASE ... ACCOUNT ...,实际 ACCOUNT 列表包含全部 129 个名称,没有省略或分批。mo_catalog.mo_pubs和mo_catalog.mo_subs,检查失败后是否残留部分目录/授权。错误原文:
三轮都验证了失败原子性和默认配置成功对照。20707 与 20105 是两种实际观察,不能把它们合写成同一种已证明根因;20105 与已有 #33325 的共享范围锁症状相关,但本轮没有证明二者全部调用链完全相同,也没有重复提单。
待解决点
8fe4b0e的QA prepared metadata, role rules and scan acceptancejob 在 release checkout 上执行四个根测试各三次,明确检查 PASS 次数。新增 job 的 CI 仍待完成。未把 129 失败写成预期成功的 golden,也未往 MatrixOne 主库提测试 PR。最终结论:测试不通过。未通过项:最新本轮 4.2-dev 在 max-row-lock-count=4 / max-fixed-slice-size=16 下,129 命名接收方创建发布连续三轮失败(20707、20105、20707);同 SQL 的默认 CN 对照均成功且授权精确,失败回滚无部分授权。原始小规模锁范围与恢复符合预期;大 catalog/混合负载及新增 CI 尚未完成。本次不关闭、不转派。
Ariznawlll commentedon Nov 30, 2026
原锁范围验收通过;129 接收方低预算反例已拆分
原 Issue 的 1/17 个命名接收方、无关账号 DROP、真实接收方等待、旧 ID 授权清理及跨 CN 恢复控制,在 4.2-dev
2bdc8daf527846ace58ab465c33127d02174e83b上四个原生根测试各 3 轮,合计 12/12 PASS。该范围与低预算 129 接收方扩展不同。MOTR 已由 PR 353 的提交
8fe4b0e5da55803d8d031d3c018fba7f62f245cb接入QA prepared metadata, role rules and scan acceptance,对四个根测试执行三轮硬计数;当前 PR head29ec7643be4b62d9cc81d0d0f6e8850bf0f9b894仍包含该提交。远端检查不以 pending 冒充成功。受限 publisher(
max-row-lock-count=4、max-fixed-slice-size=16)上的 129 命名接收方失败已另提 #33506:#33506 。三轮20707 / 20105 / 20707、失败原子性及默认 CN 对照均保留在新 Bug;没有录成 PASS golden,也不推断默认大 catalog/混合负载已经验收。因此关闭本 Issue 的原始锁范围;#33506 继续保持 OPEN。