Repository navigation
Description
Environment
| Field | Value |
|---|---|
| Cluster | mo-stb-4-2-dev-2734005-202607231128 |
| Namespace | mo-stb-4-2-dev-2734005-202607231128 |
| Image | matrixone:commit-66dad1483 (rolled onto this soak ~2026-07-24 14:16 CST) |
| Endpoint | 10.222.6.255:6001 |
| Artifact root | /data1/stability-test/29976993561_2734005 |
| Workloads | TPCC, sysbench-1, TPCH, qvec, fulltext, issue-24446, issue-10313 |
| Hang window | TPCH q15 started 2026-07-26 15:05:28 CST; still COM_QUERY at analysis 2026-07-27 ~11:25 CST (~20h+) |
Scope: On a healthy soak (no CN roll at hang time), TPCH q15 never returns. Session stays alive in SHOW PROCESSLIST. Leak-check periodically emits found leak txn for the same txn-id → quality gate FAIL (unique=1). Goroutine dump shows the statement stuck in CN↔CN RemoteRun receive and local PipelineSignalReceiver, not LockService bind.
Out of scope / not this issue:
- Lock bind /
20702/failed to keep lock table bind— 0 after the Jul-24 image roll settled (only roll-window noise). wait-active/createTxnOpUnsafe/ panic /+Inf/ OOM — 0 in the hang window.- TPCC consistency — PASS throughout.
- [Bug] Stability test:
leak txn— 10 orphaned txns survive CN roll ~9.5h; session disconnect does not rollback #24766-class disconnect-without-rollback orphans (here the mysql client and session are still connected).
Related: #26125 (roll-time hangs; aptend: nested shuffle / remote dispatch paths), #25816 (PipelineSignalReceiver), #26025 / #26055 / #26097 (candidate fixes — need confirm whether 66dad1483 includes them; hang still reproduces on this image).
Summary
| Signal | Value | Interpretation |
|---|---|---|
| Hung SQL | TPCH q15 (CTE q15_revenue0 + join + nested max) |
Not a slow query — 20h+ with no progress |
txn-id |
18dd0759dd8a4d5618c52552667de939 |
Same id in processlist + leak logs |
session_id |
019f9d3e-36bc-7bdb-a855-3a18c47d98d9 |
|
statement_id |
019f9d3e-373e-726b-b776-ffa6052d3268 |
|
conn_id / CN |
2109660 on CN uuid 32656637-3565-3161-6238-393530343535 (tp-cn-glpzt) |
|
goRoutineId (leak options) |
24984370 |
Matches pprof stack below |
| Leak unique | 1 (hits ≈117 over ~24h; do not count log lines) | Gate FAIL |
wait-active |
0; commit ~180/s | Cluster otherwise healthy |
| Parent wait | Compile.runOnce chan receive, 1221 minutes |
Waiting for child scopes |
| Child A | messageSenderOnClient.receiveMessage select, 1219 minutes |
Remote CN batch never arrives / never EOFs |
| Child B | PipelineSignalReceiver.GetNextBatch → Merge → MergeGroup → HashJoin 1219 minutes |
Local merge starved |
MatrixOne defect: Distributed pipeline for this q15 plan can deadlock / hang without error or cancel: RemoteRun blocks forever in receiveMessage, local consumers block in PipelineSignalReceiver, frontend never leaves Compile.Run. Leak-check then mis-labels the still-live aged statement as found leak txn.
Timeline (CST)
| Time | Event | Evidence |
|---|---|---|
| 07-24 ~14:16 | Full-stack image roll to 66dad1483; CN glpzt created |
pod creationTimestamp |
| 07-24 15:00→ | Lock bind / wait-too-long / 20702 quiet | Loki + client error file |
| 07-26 15:05:27 | q14 OK (cost 67245 ms); start q15 | tpch/.../run.log |
| 07-26 15:05:28 | query_start / txn create-at |
processlist + leak create-at UTC 07:05:28 |
| 07-26 ~17:58+ | First found leak txn lines for this txn-id |
Loki / CN logs |
| → 07-27 11:25+ | Still COM_QUERY q15; TPCH run.log frozen; pprof stacks ~1221 min |
processlist + :6060/debug/pprof/goroutine?debug=2 |
Evidence
A. processlist (still present)
account=tpch_test conn_id=2109660
session_id=019f9d3e-36bc-7bdb-a855-3a18c47d98d9
txn_id=18dd0759dd8a4d5618c52552667de939
statement_id=019f9d3e-373e-726b-b776-ffa6052d3268
query_start=2026-07-26 07:05:28.126918 +0000
command=COM_QUERY
info=with q15_revenue0 as ( select l_suppkey ... ) select ... from supplier, q15_revenue0 where ...
Client: timeout 86400s mysql ... + bash ./run.sh still running under artifact (PID from Jul26).
B. leak log (repeats ~every 10min)
ERROR cn-service found leak txn
txn-id=18dd0759dd8a4d5618c52552667de939
create-at=2026/07/26 07:05:28.126941 +0000
SessionID=019f9d3e-36bc-7bdb-a855-3a18c47d98d9
ConnectionID=2109660 UserName=admin account=tpch_test
goRoutineId=24984370
profile=ETL:/profile/CN_32656637-..._leakcheck_routine_....gz
C. Goroutine stacks (CN glpzt, curl :6060/debug/pprof/goroutine?debug=2)
Same Compile pointer 0x10151f3bc588 on parent + remote child.
Parent (session / leak goRoutineId):
goroutine 24984370 [chan receive, 1221 minutes]:
compile.(*Compile).runOnce compile.go:587
compile.(*Compile).Run compile2.go:261
frontend.executeResultRowStmt result_row_stmt.go:102
frontend.executeStmt / doComQuery mysql_cmd_executor.go
frontend.(*Routine).handleRequest
Remote receive (never completes):
goroutine 24980847 [select, 1219 minutes]:
compile.(*messageSenderOnClient).receiveMessage remoterunClient.go:567
compile.(*messageSenderOnClient).receiveBatch remoterunClient.go:586
compile.receiveMessageFromCnServerIfConnector remoterunClient.go:257
compile.(*Scope).remoteRun / RemoteRun remoterunClient.go:109 / scope.go:457
compile.(*Scope).MergeRun.func1 scope.go:321
ants goWorker
Local merge / join starved:
goroutine 24983552 [select, 1219 minutes]:
process.(*PipelineSignalReceiver).listenToSingleEntry / GetNextBatch process_spoolr.go
colexec/merge.(*Merge).Call
colexec/group.(*MergeGroup).Call
colexec/hashjoin.(*HashJoin).Call
colexec/loopjoin.(*LoopJoin).Call
… filter → projection → order → mergeorder …
Expected vs actual
| Expected | Actual | |
|---|---|---|
| q15 | Finish in minutes (historical TPCH on same suite) or return error | Hang 20h+ |
| Pipeline / RemoteRun | Bounded wait + cancel/error on peer stall | Infinite receiveMessage / GetNextBatch |
| Leak-check | Only true disconnect orphans, or once | Periodic ERROR on live hung statement → gate FAIL |
Suspected code paths
| Area | Path |
|---|---|
| Remote pipeline client | pkg/sql/compile/remoterunClient.go (receiveMessage / remoteRun) |
| Pipeline spool | pkg/vm/process/process_spoolr.go (PipelineSignalReceiver) |
| Compile wait | pkg/sql/compile/compile.go (runOnce) |
| Leak-check | CN leakcheck routine — should distinguish live COM_QUERY vs disconnect orphan |
Likely same family as #25816 / fixes discussed under #26125 (#26025, #26055, #26097). Please confirm whether 66dad1483 contains those commits; if yes, this is a residual / different plan shape (q15 CTE + nested max + hash/loop join) still hanging.
Suggested fixes
- MO: Ensure RemoteRun / PipelineSignalReceiver always unblocks on peer CN failure, cancel, or idle timeout; propagate error to
Compile.Run. - MO: Statement/query cancel deadline for distributed pipeline (do not rely on client
timeout 86400salone). - MO / gate: Leak-check: do not treat still-present processlist
COM_QUERYas disconnect leak (or severity/unique policy for hang vs orphan). - Verify: After fix image, soak TPCH past q15 under dual-CN;
found leak txnunique=0; pprof must not show multi-hourreceiveMessage+runOncepairs for the same Compile.
Workaround (ops)
KILL connection / session 019f9d3e-36bc-7bdb-a855-3a18c47d98d9 (or txn 18dd0759…e939) so TPCH can advance; does not fix root cause.
Activity
aptend commentedon Jul 27, 2026
Root cause identified: terminal state can be lost as a receiver wakeup
The #26202 hang and the residual vector
UPDATEhang in #26125 are the same pipeline-lifecycle defect class.Root cause
PipelineEdgehas two representations of terminal state:Ch2; andDone()/Err().On a fatal terminal (
Error/Abort), the edge records the fatal state and closesDone()before attempting to enqueue all required terminal signals intoCh2. IfCh2is backpressured, the enqueue can time out or remain incomplete.However,
PipelineSignalReceiver.listenToSingleEntrythroughlistenToEightEntrywait only on:receiver.usrCtx.Done(); andreg.Ch2.They do not observe
PipelineEdge.Done(). Therefore an edge may already be terminal while a receiver that did not obtain the terminal item remains blocked onCh2forever. The wait then propagates upward:This is why cancellation/cleanup can have happened without returning an error to the live SQL session.
The hand-written 1–8-way
selectis not an input-count limit: more than eight entries usereflect.Select. The defect is the missing terminal-state wakeup in both paths, not the number of receivers.Fix direction
The receiver must treat
PipelineEdge.Done()as a lifecycle wakeup while preserving queued-data ordering:Ch2signals first;Done();The same implementation covers #26202 on
4.2-devand #26125 onmain. Since a GitHub PR has one base branch, this should be one logical fix/patch with separate branch PRs (first4.2-dev, then the same change forward-ported tomain).Evidence for #26202
The q15 session remains live while its execution tree is permanently split between
PipelineSignalReceiver.GetNextBatch,messageSenderOnClient.receiveMessage, andCompile.runOnce. That stack is the expected terminal-wakeup failure shape, rather than a LockService wait or a slow operator.A regression should explicitly cover a fatal edge whose data channel is backpressured and verify that the receiver still exits through
Done()/Err()instead of waiting indefinitely.[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…