Repository navigation
Description
Environment
| Field | Value |
|---|---|
| Cluster | mo-stb-main-3ebdb25-202607101119 |
| Namespace | mo-stb-main-3ebdb25-202607101119 |
| Image (incident) | matrixone:commit-90e3400 (full-stack roll inside the window) |
| Endpoint | 10.222.6.254:6001 |
| Artifact root | /data1/stability-test/29066558663_3ebdb25 |
| Workloads | TPCC, sysbench, TPCH, fulltext/vector (ivf_dml_scenarios) |
| Analysis window | 2026-07-23 10:00 CST → 2026-07-24 ~10:40 CST (~24h; roll is inside the window) |
Scope: After a CN / full-stack roll, a small subset of statements already on the execution path never return during a LockService lock table bind changed storm (stuck after Exec.Build completes or after ranges), while the client blocks until query_result_timeout / wait_timeout (~24h). Peer statements on the same table correctly fail after a 10s retry budget. Leak-check reports those still-COM_QUERY aged txns as found leak txn (unique=2) → release gate FAIL.
Out of scope / not this issue:
- [Bug] Stability test:
leak txn— 10 orphaned txns survive CN roll ~9.5h; session disconnect does not rollback #24766-class “disconnect without Rollback” orphan txns (here the session is still alive; processlist shows the samesession_id/txn_id). - Durable consistency corruption (consistency PASS in this window).
wait-active/createTxnOpUnsafe/ panic /+Inf(all 0 in this window).
Summary
| Signal | Value | Interpretation |
|---|---|---|
| Roll time | 07-23 11:38–11:42 CST | log/DN/proxy/CN restart steps; CN qr22s → swzgh |
| Hung #1 | TPCH q10 txn=54298e79…e6ef |
After Exec.Build @11:40:15 → 23h+ with no Exec.Run completion |
| Hung #2 | vector UPDATE test_vectors txn=442f9f6c…cf8a |
Silent after ranges @11:41:22; tbl-id 318606 |
| Same-second peer fate | 11:41:32 lock retry budget exhausted / lock table bind changed |
Same table other INSERT/UPDATE fail correctly |
| Historical q10 | 45–120s | Same artifact run.log; 23h = hang, not slow query |
| Client | mysql in tcp_recvmsg; session wrapped by timeout 86400s |
No statement-level timeout |
| Server timeouts | have_statement_timeout=off, max_execution_time=0, query_result_timeout=24 |
Hang can last ~24h |
| Leak unique | 2 (do not count log lines) | Leak-check every ~10min on both CNs |
wait-active |
0; commit after roll ~150–200/s | Not a txn-create stall |
MatrixOne defect: When LockService bind becomes invalid during a roll, the error-return path is incomplete: some waiters/pipelines finish “10s retry → error”, while statements already in Exec.Run / lock wait get neither context cancel nor error until the client times out. Leak-check also conflates “aged statement with a live session” with “disconnect orphan txn”.
Timeline (CST)
| Time | Event | Evidence |
|---|---|---|
| 11:38–11:42 | Full-stack roll to 90e3400; Starting shutdown; failed to keep lock table bind ×19 |
Loki + kube_pod_container_status_restarts_total step |
| 11:39:59 | CN swzgh start |
pod startTime |
| 11:40:10 | TPCH run.log: start q10 |
artifact |
| 11:40:14–15 | New connection accept; Exec.Build 1.62s; then this txn has only leak logs, no Run completion |
Loki 019f8d0f-3d89… / txn-id |
| 11:41:22 | Vector new connection (55wzr); txn.table.ranges.log blocks=456 (55wzr + swzgh) |
Loki |
| 11:41:32 | Same table 318606: lock table bind changed + lock retry budget exhausted for backend availability error (retry-budget 10s) → other vector statements ERROR |
Loki lockop/lock_op.go |
| ~12:00+ | Both hung txns start periodic found leak txn |
Loki |
| → +23h | processlist still same COM_QUERY; TPCH run.log stuck on q10; client still ESTAB + recv |
show processlist / /proc/.../stack |
Evidence
A. TPCH — Build then no Run
11:40:15 cn-swzgh frontend/mysql_cmd_executor.go
msg="time of Exec.Build : 1.619007149s"
session_id=019f8d0f-3132-7ea5-8668-4923f89521ba
statement_id=019f8d0f-3d89-72c1-b153-52004150213f
txn-id=54298e79cad2cfb818c4ce238373e6ef
# For this txn-id after Build until analysis time: non-leak logs = 1 (Build only); rest are found leak txn
Baseline (same run.log, before roll):
query q10 has be executed successfully, and cost: 45059–120349 # ~45–120s
B. Vector — silent after ranges; peers on same table fail-return
Hung txn ranges:
{"msg":"txn.table.ranges.log","name":"test_vectors","tbl-id":318606,
"txn":"442f9f6cddb96da118c4ce357ba8cf8a/Active/...",
"blocks":456,"cost":"593.135µs"}Same second (other txns, correct failure):
{"caller":"lockop/lock_op.go:1120",
"msg":"lock retry budget exhausted for backend availability error",
"table-id":318606,
"error":"lock table bind changed",
"retry-budget":"10s",
"txn-id":"54298e79cad2cfb818c4ce23837482b5"}{"caller":"frontend/txn.go:64","msg":"lock table bind changed",
"session_info":"... account vector_test:admin ..."}C. processlist (still present at analysis time)
| conn_id | account | query_start (UTC) | info |
|---|---|---|---|
| 11188054 | tpch_test | 2026-07-23 03:40:14 | TPCH q10 SELECT … |
| 11188783 | vector_test | 2026-07-23 03:41:22 | UPDATE test_vectors SET embedding=… WHERE id='uqjmox…' |
D. Timeout config (amplifies hang window)
have_statement_timeout = off
max_execution_time = 0
query_result_timeout = 24
wait_timeout = 86400
Root cause
Mechanism
CN / LockService roll
↓
lock table bind changed (keeper / peer CN down)
↓
Path A (majority): lockop retry ≤10s → error to client → retryable ← OK
Path B (minority): past Build / ranges, in Run or lock wait
→ bind change does not cancel pipeline / waiter
→ never returns ← defect
↓
Client has no statement timeout → blocks ~24h
↓
leak-check reports found leak txn by txn age (session still Active)
Why this is a MatrixOne bug (not “it would finish without kill”)
| Observation | Implication |
|---|---|
| Same table, same second: most statements fail in 10s, two show 23h with no progress | Fail path exists but does not cover all execution stages |
Historical q10 ~1min, now 23h + no Exec.Run |
Hang, not a slow query |
processlist still same session_id / txn_id |
Not a #24766 disconnect orphan; execution hang |
wait-active=0, commit healthy |
Not a global txn-scheduler death |
Expected vs actual
| Expected | Actual |
|---|---|
| Bind change → all related waiters/pipelines fail or cancel | Some statements hang forever |
| OLAP/DML have a reasonable statement timeout | max_execution_time=0; hang can last ~24h |
found leak txn ≈ disconnect-without-Rollback orphans |
Aged statements with live sessions also reported as leak |
| After roll, TPCH/vector recover within minutes | TPCH stuck on q10; one vector worker stuck; leak unique=2 |
Proposed fixes
P0 — MO: bind change must reach Run / lock wait
pkg/sql/colexec/lockop/ LockService waiter: for any txn holding or waiting on the affectedtable-idbind, onlock table bind changeduniformly error or context-cancel; do not allow silent block past the retry budget.Exec.Run/ pipeline: on CN roll or lock-bind invalidation, propagate cancel into in-flight pipelines (align with existingStarting shutdownpath; cover the window where a query just started on a new CN while the old bind is already invalid).
P1 — MO: statement timeout + leak classification
- Default or configurable
max_execution_time/ statement timeout (suggest soak OLAP ≤30min, OLTP DML ≤ a few minutes); on timeout → kill query + Rollback. - Leak-check: distinguish disconnect orphans vs aged statements still in
COM_QUERY; for the latter, alert and optionally auto-cancel (e.g. after 1h) instead of log-only.
P2 — Operator / soak scripts
- CN drain: reject new SQL and cancel in-flight work before shutdown.
- TPCH: replace session-wide
timeout 86400swith per-statement timeout; set pymysqlread_timeoutfor vector. - Post-roll runbook:
processlistrows withquery_startolder than N minutes →KILL <conn_id>(ops mitigation, not the root fix).
Verification
- While TPCH q10 /
UPDATE test_vectorsis running, trigger a CN roll or lock-bind switch: expect error or cancel within seconds to ~10–20s; must not still beCOM_QUERYwith noExec.Runafter 20+ minutes. - Within 30min after roll:
found leak txnunique=0 (or only short-lived then cancelled). - TPCH
run.logadvances past q10; vector workers do not permanently stick on a single UPDATE.
Related
- [Bug] Stability test:
leak txn— 10 orphaned txns survive CN roll ~9.5h; session disconnect does not rollback #24766 /issues/matrixone-chaos-07924fb-leak-txn-sys-session-cleanup.md— disconnect without Rollback (different path; same leak gate class). issues/matrixone-stability-58c90b8-lockservice-long-wait.md— LockService long wait / bind invalidation class.
Activity
aptend commentedon Jul 24, 2026
Independent follow-up and issue linkage
I re-checked the two stuck transactions against the IDC Loki data and the leakcheck goroutine profiles. The hang is real, and the roll/draining window is an important trigger, but the available evidence does not connect either stuck transaction to an
ErrLockTableBindChangedlock wait.For the full 24-hour window, exact txn-id searches returned:
54298e79...73e6ef: 146 records (141 leak reports, 1Exec.Build), with 0lock table bind changed, 0 lock retry, and 0Exec.Runcompletion.442f9f6c...ba8cf8a: 146 records (141 leak reports, 2 range logs), with 0lock table bind changed, 0 lock retry, and 0Exec.Runcompletion.The same-table/same-second statements that exhausted the 10-second lock retry budget were different transactions. They establish that a bind-change storm existed, but do not establish that these two transactions entered that error path.
The goroutine evidence points to two already-known pipeline defects that were not included in incident image
90e3400:TPCH q10: the frontend is blocked in
Compile.runOncewaiting for scope results; child scopes are blocked inMergeRun, with many workers inshuffle.(*Shuffle).Callfor the full query lifetime. This matches the nested local-shuffle wait cycle tracked in [Bug] TPCH Q16 hangs indefinitely: Shuffle execution engine deadlock in waitBatchOrEnd (TPCH 100G stuck for 15+ hours) #25922 and addressed by fix: prevent nested local shuffle deadlocks #26055 (0d7eeb38) and the execution-layer follow-up fix: decouple local shuffle producers from consumers #26097 (27cf9a7e).vector UPDATE: connection
11188783was accepted by55wzrabout 26 seconds after that CN loggedStarting shutdown. The coordinator is blocked inCompile.runOnce; one remote scope is blocked inreceiveMessageFromCnServerIfConnector. The apparentLockOpstack is actually waiting for upstream data inPipelineSignalReceiver -> Merge, not insideLockService.Lock. Onswzgh, the corresponding remote-server pipeline is also blocked inPipelineSignalReceiver/ nestedRemoteRun -> MergeRun. This is consistent with the remote dispatch receiver placement/lifecycle class tracked in [Bug] 30s remote dispatch watchdog can falsely fail slow receiver registration #25816 and fixed by fix(pipeline): normalize retained dispatch receiver routes #26025 (ebd05ba52). The profile does not expose receiver UUID/FromAddr, so the exact fix(pipeline): normalize retained dispatch receiver routes #26025 subcase is a high-confidence match rather than a fully proven identity.Therefore the recommended next step is validation, not another speculative LockService change:
COM_QUERYbeyond 20 minutes;found leak txnentries after the roll.If the issue reproduces on that image, it should remain open with the new goroutine/receiver evidence and be treated as a remaining shutdown/pipeline cancellation defect. If it does not reproduce across repeated roll windows, the two observed hangs are best considered covered by the linked shuffle/remote-dispatch fixes. The separate hardening items remain valid: a draining CN should stop accepting new SQL, in-flight pipelines need bounded cancellation, and
found leak txnshould distinguish live long-running statements from disconnected orphan transactions.aptend commentedon Jul 27, 2026
Root-cause update: same terminal-wakeup defect as #26202
The canonical root-cause explanation is in this #26202 comment; it is not repeated here.
For the
f3752fce3main reproduction, the new evidence aligns with that mechanism:f3752fce3already contains fix(pipeline): normalize retained dispatch receiver routes #26025, fix: prevent nested local shuffle deadlocks #26055, and fix: decouple local shuffle producers from consumers #26097, so this reproduction is not explained by those fixes being absent.55wzr, both vectorUPDATEsessions remain blocked inCompile.runOnce; a child scope is blocked inmessageSenderOnClient.receiveMessage, with local children blocked inPipelineSignalReceiver/Merge.pg95j, the two execution trees present in the 10:11/10:12 goroutine dumps are no longer present by 10:20, while the coordinator remains blocked. This is consistent with remote execution/cleanup completing without the coordinator-side pipeline receiving a usable terminal wakeup.f3752fce3cluster independently logged live terminal-delivery failures such asconnector cleanup timed out sending terminal End/Abort signalwith a backpressuredCh2(channel_len=13,channel_cap=14). Those warning lines belong to another transaction, so they prove the failure condition exists in this cluster but are not claimed as the direct log record for these two UPDATE transactions.Therefore the current root-cause classification for the main reproduction is:
This supersedes the earlier “likely covered by #26025” conclusion for the vector UPDATE. It is not a LockService wait, and it is not the 1–8 hand-written
selectcount.The same logical patch as #26202 should be forward-ported to
main. Validation for this issue should rerun the vector workload across CN/full-stack rolls and require the UPDATE to finish or return an error within a bounded interval, with no persistent live-sessionfound leak txnentries.[4.2-dev] fix(pipeline): wake receivers from terminal edge state (#26228
[main] fix(pipeline): wake receivers from terminal edge state (#26250)
[main] fix(pipeline): wake receivers from terminal edge state (matrix…
[main] fix(pipeline): wake receivers from terminal edge state (matrix…
[main] fix(pipeline): wake receivers from terminal edge state (matrix…