Repository navigation
Description
Description
In the long-running 4.2-dev distributed Chaos environment, requests already in flight during a single-CN pod kill returned 20702: lock table bind changed after approximately 150 seconds. The server recorded a 10-second backend lock retry budget and logged that the budget was exhausted about 140 seconds after its own deadline. Other requests had resumed making progress during the same period.
This report records an observed production-like test incident, not a controlled reproduction. The causal explanation below is a strong hypothesis, not yet a proven per-transaction root cause.
Environment
- Branch:
4.2-dev; observed image tag:commit-b97995b. The tag resolves to source commitb97995b007051b28d0f98bffc6f210da0aa9b866, but the full runtime SHA was not independently verified from the running binary. - IDC distributed test: 2 CN, 1 DN, 3 LogService and 1 Proxy;
mo-chaos-4-2-dev-fca65de-202608290941. Existing long-running setup: run 33227006312. - Workload: concurrent Sysbench inserts through the existing test harness. Times below are 2026-11-17, UTC+8. The preceding 4.2-dev image update ended at 01:04:20, outside both observed windows.
Observed sequence
- At 06:11:31 a CN PodChaos fault started; the fault resource was removed at 06:12:02. Seven logged Sysbench requests initiated around 06:11:33 returned
20702around 06:14:03, approximately 150 seconds later. - In a separate rotation at 09:42:20 a CN PodChaos fault started; the fault resource was removed at 09:42:51. Seven Sysbench requests initiated during that fault returned the same error at 09:45:16–09:45:18, approximately 150–151 seconds after their recorded request times.
- For one affected transaction, the surviving CN logged remote lock connection failures from 09:42:48;
retry-budget=10sandretry-deadline=09:42:58.432were recorded when the budget was reported exhausted at 09:45:18.462, about 140 seconds after that deadline.
The fault resource's removal time is not itself proof that all cluster components had recovered. Sysbench throughput resumed by the 09:43:27 sample, while the older requests remained outstanding. The 09:43 TPCC consistency checker failure was a SQL exception (backend connection closed), not a demonstrated data mismatch; later TPCC consistency checks succeeded.
Expected behavior
A backend-unavailability retry budget should not be silently bypassed by an in-flight attempt for approximately two additional minutes. Affected requests should terminate or otherwise be bounded according to the intended backend retry and cancellation policy, while normal lock waits, error semantics, transaction cleanup and unrelated requests remain correct.
Code analysis — hypothesis, not yet confirmed root cause
- In incident-version
lock_op.go, the backend retry budget is 10 seconds. The retry loop checks the retry state after a lock call returns; the backend retry deadline is not visibly propagated as the deadline of that in-flight call. - The remote-lock RPC context uses the lock-wait deadline plus 30 seconds. The incident-version default lock wait is 120 seconds. A later read-only check found the current global value and a newly created admin session both at 120 seconds; the actual incident sessions' values were not verified. The observed 150 seconds is consistent with 120 + 30, but numerical agreement alone is not proof.
- A Pyroscope aggregate block profile, for the affected surviving CN and 09:43–09:45 window, included
lockWithRetry → lockservice.(*service).Lock → remoteLockTable.lock → morpc.(*client).Send → waitBackendChange → waitBackendCreateCompletion. This is a process-wide aggregate, not a transaction-specific goroutine stack and not proof that this path accounts for the full gap in the cited transaction. - Hypothesis: once a backend error establishes the 10-second deadline, an in-flight remote lock/backend creation wait can outlive that deadline because it uses a different longer context. Confirm the actual blocked frame, exact cancellation/timeout behavior, and whether this is intended before attributing the root cause conclusively.
Stability and controls
- Two separate natural Chaos rotations produced the described timing pattern; the counts are observed log records, not 2/2 controlled reproductions.
- No isolated reproducer, no-fault control, latest-
mainruntime test, or data-atomicity verification was performed. Thelock_op.gofile content was identical in the observed source revision and the then-current4.2-devheadfc6c7fee10f14591dd60fd6b35464b6361d8ab42; other dependencies may differ and current behavior is unverified. - Need a controlled 2-CN fault test and passing no-fault control, repeated on latest official
mainand4.2-dev, retaining the in-flight call stack and checking cleanup, errors and transaction outcomes.
Evidence
- Existing test setup: run 33227006312. Actual workload logs and cluster observations are from the long-running process after this setup, not from the completed Actions job's status.
- IDC Grafana cluster dashboard for the 09:42–09:47 incident; access requires the normal internal authorization.
Related
- #31184: 20702 after CN loss for catalog DDL; a shared root cause is unproven.
- #26125: historical, closed report of hung statements following a roll; distinct observation and unproven relationship.
- #27523: surviving CN retries a killed CN's pipeline endpoint; this report observes a lockservice path and does not assert the same failure.
Activity
[4.2-dev] fix: bound lock backend retry waits (#32843)
XuPeng-SH commentedon Nov 17, 2026
QA 交接补充(不代表验收通过)
PR #32843 已于 2026-11-17 07:47:43 UTC 合入 4.2-dev,merge SHA
2cf82017d5b5488cf68c15c3b15cf1abf56084fc,head77c345bb85a0eead3f924b97b8e4c053b03d7c7d。本 issue 已由 @Ariznawlll 负责,仅补交接证据,保持 open,不变更负责人。修复将已有 lock retry deadline 传入 backend 选择、连接创建等待、重试退避及 allocator bind refresh;保留健康 backend 上正常 lock-request context。它修复已演示的 backend-wait 预算缺口,尚未证明是原 Chaos 事件全部约 150 秒等待的根因。
现有证据(本巡检未本地测试):
QA 建议在受控 2-CN 故障恢复下验证 backend-unavailability budget,并以健康 backend 对照确认普通锁等待不被缩短。捕获事务级阻塞栈、预算时间和最终错误,检查取消/清理/原子性/后续请求恢复。原证据为自然 Chaos 轮转及进程聚合 profile,不是事务级因果证明;不保证所有 post-dispatch wait 受硬预算约束,也不表示 main 或其他版本已验收。
Ariznawlll commentedon Nov 20, 2026
QA 阶段性进展(2026-11-20,仅精确白盒通过,尚未闭环)
针对 #32843 已合入 4.2-dev 的 backend 选择、连接等待、重试退避及 allocator bind refresh 预算传递,现有 MORPC / lockservice / lockop 的 12 个精确测试已连续三轮通过。这些测试证明所选取的 context/deadline 路径,不等于原始 CN 丢失场景已恢复。
尚未在受控双 CN Chaos 中复测原约 150 秒等待;事务级阻塞栈、实际预算耗时、最终错误、取消/清理、事务原子性及后续请求恢复仍缺真实证据。健康 backend 的正常锁等待不被提前截断也需保留对照。
因此目前只记录局部白盒通过,不宣布原问题修复或性能恢复,不关闭 issue。生产 Chaos 的完整根因与 main/其他版本适用范围不由本次局部测试外推。
Ariznawlll commentedon Nov 28, 2026
结论
未完成验收。此前本地证据及本轮 Linux CI 的真实 CN 故障、恢复后数据核对、底层预算测试均通过。2026-11-30 已补齐 CI,新增证据见下;原始长期 Sysbench/Chaos 负载仍未完成,因此本次不关闭,不转派。
关键证据
版本与实际环境
4.2-dev:ea874f3f23cb14f2856d092c87d3c80cba117a97,包含修复 [4.2-dev] fix: bound lock backend retry waits #32843(2cf82017d5b5488cf68c15c3b15cf1abf56084fc)。不以 main 的结果代替 4.2-dev。git_version()完整 SHA;实际读取SHOW LOGSERVICE REPLICAS核对三个投票副本。SIGKILL,不是模拟 RPC 报错,也不是优雅 Close;不涉及共享环境或其他实例。复现步骤与检查点
A(1,10)、B(1,20)。CN2 开事务更新 B 为 30 而不提交;CN1 开事务更新 A 为 11,再执行更新 B 为 21,使其阻塞。mo_locks确认 B 的真实持锁 CN/事务,并确认更新请求仍阻塞后才注入故障。健康对照先等待超过 12 秒,再回滚持锁事务,确认阻塞更新正常完成,不能因为 10 秒 backend 预算误杀正常锁等待。-9外,其余服务和重启的 CN2 均正常退出。三轮正式 MOTR 脚本执行结果
故障时实际错误:
重启后第 2、3 轮第一次写入各出现一次
20702 lock table bind changed;使用新连接/新事务重试后恢复,已计入上表写就绪时间,没有隐去瞬态错误。所有轮次均断言回滚没有保留 A=11 或 B=21,恢复后的新提交能够跨入口读到 A=10/B=22。这些毫秒级结果只证明本次实际断连路径及时报错,不等于已重现并修复原始长期负载下的 150 秒停滞。 该路径 TCP EOF 很快可见,不能据此单独证明所有 backend 重试路径都遵守 10 秒预算;预算语义另由定向源码测试验证。
底层定向验证
覆盖 12 个已有测试:嵌套预算取最早截止时间、失联 backend、调用方取消、健康请求不被缩短、bind refresh 剩余预算和已过期预算、在途重试、健康锁等待、取消后的错误返回、换 bind 不重置预算及预算耗尽退出。普通运行每项 10 次,120/120 通过;race 每项 3 次,36/36 通过,未报告数据竞争。
历史交付与当时未完成项
4.2-dev;提交12df74672c4ce79c23f706126d0570e6d6d97a44。没有新建 MatrixOne 主库测试 PR。.github/qa/issue_32834_topology.py、issue_32834_cn_loss.py、run_issue_32834.py;现有QA 4.2 remote lock rollback cleanup 33166job 增加普通/race 定向测试及三轮真实 CN kill/restart。4.2-dev并执行对应 action。需先合入 Fix bug of merge empty batch #353 再合入调度入口;未合入不能声称已每日运行。The job was not started because an Actions budget is preventing further use.,因此 CI 尚未验收,并非测试断言失败。2026-11-30 Linux CI 补验(原 CI 阻碍已解除)
2bdc8daf527846ace58ab465c33127d02174e83b。运行时由三个 SQL 入口核验完整版本,不混用 main。qa33166-42-acceptance(约 14 KB),不是仅依据 Actions 绿色标记判断。EADDRINUSE属于启动前检查失败,既不计作产品失败,也不计作通过。这次 Linux 故障路径实际返回:
三轮均在约 10 秒返回,确实走到了 backend retry budget 耗尽路径;与此前 macOS 快速 EOF 的毫秒级路径不同。健康 backend 上先等待超过 12 秒后仍成功,说明没有简单地把全部正常锁等待截断为 10 秒。
三轮重启后的首个写尝试均记录过一次
20702 lock table bind changed,新连接/事务重试后约 0.92 秒恢复;未隐去这些瞬态错误。故障事务回滚后核对 A=10/B=20,恢复的新提交经 CN 和 Proxy 读回 A=10/B=22。底层 12 个预算测试普通各 10 次、race 各 3 次均通过,120/120 与 36/36;其作用是补充具体 context 传播及取消语义证据。本轮补充:真实插入负载中的三轮 CN 故障与全重启
4.2-dev@91c59a43bd519f7cccee408035cbf6c5b13dc0e2,服务二进制 SHA256b2ea51fca495e858ff066c9bbf617a38c86e86a8cefcb7775b0dffdf0d60663d,无产品源码 overlay。两个 CN 与 Proxy 各自核对完整 git_version()。1a7886fc7566dfc9fd85a81801f09471151365d3,10 表,每表预置100,000行,10线程,真实 oltp_insert.lua 连续600秒;使用持久连接,经Proxy写入。设置 mysql-ignore-errors=all 以继续经历故障,不代表没有错误。在途UPDATE总耗时从提交查询开始计时,杀CN后由轮询观察到完成约1.03–1.06秒(包含采样间隔),不是恢复SLA。每轮重启后首次写都经历一次20702 lock table bind changed,重新尝试后成功,未忽略该瞬态。
原始负载汇总:
故障窗口出现吞吐下降和错误,随后恢复到持续写入;不能描述为“全程零中断”。结束时实际10表合计1,896,197行。它比初始百万行加Sysbench已计事件数多6行,断连时提交结果存在不确定性,本脚本没有逐条客户端ACK账本,不据此认定重复写或宣称所有ACK逐条一致。
负载结束后对10表分别保存 COUNT、SUM(id)、SUM(k)、BIT_XOR(CRC32(c||pad)),完整停止并重启7服务,再计算指纹全部一致;3个审计库通过两个CN/Proxy再次精确读到10/22。指纹检查不是全量逐字节行对比。两次完整停机共14个正常退出码0,3次计划SIGKILL分别明确记录为-9。
同一官方源码的12个预算测试再次普通模式各10轮、race各3轮:120/120与36/36通过,0失败。错误预算、较早deadline、正常锁等待、取消和bind刷新不重置预算均覆盖。
测试驱动开发中的失败也保留:首次 Lua 加载到了系统同名公共模块,缺check_reconnect,尚未注入故障;修正LUA_PATH。第一次故障快速返回1105连接重置,旧断言只接受20505/20702,修正为仅接受明确的reset/refused/broken-pipe传输错误;另一版在owner缺失时额外A表更新先触发10秒预算,后改为直接测B表新请求,故障前A更新及回滚原子性仍完整保留。最终上述三轮来自全新目录完整重跑,未把这些初稿失败算成产品修复失败。
回归补充
新驱动
issue_32834_sysbench_load.py与说明已加入现有 MOTR 4.2-dev #399,提交2532d60,未向MatrixOne主库提PR。旧的预算/无负载CN故障回归仍保留。CI 46752321699 在私有 mo-sysbench checkout 返回 Repository not found,产品测试未执行。已将该私有依赖从无关IVF门禁中移出,新十分钟负载驱动当前需挂载有权访问的固定源码手动执行,尚未实现该负载专项每日执行;不能把旧CI绿色结果代替它。
待解决点
最终结论:未完成验收。已通过项:最新4.2-dev十分钟百万行种子Sysbench、三轮真实CN故障、约10秒预算、回滚及恢复写入、完整重启指纹和156次预算测试。未完成项:原始长稳/自然Chaos等价场景、新负载专项托管CI与每日接入;保持开放,不转派。