Repository navigation
Description
Description
A valid distributed recursive-CTE join was aborted by the MatrixOne remote execution pipeline. The client received an internal 20101 context canceled error although the configured statement timeout was 3600 seconds and the statement had run for about 0.38 seconds.
The earliest server-side evidence for the same trace reports that a pipeline could not execute remotely because its dispatch operator targeted another local pipeline tree. This is followed by remote receiver closure and an aborted shuffle pool.
Environment
- Deployment: cn-dev
freetier-01, multi-CN distributed deployment; profiles16c64g - Regression workflow: https://github.com/matrixorigin/mo-nightly-regression/actions/runs/34021248084
- Failed job: https://github.com/matrixorigin/mo-nightly-regression/actions/runs/34021248084/job/101476204876
- Workflow source revision:
76de212c3bc05892e32c7cf436706297c78ee6eb - Observation time: 2026-09-06 13:26:16 UTC
- Concurrent workload: NESR continuous writer was enabled
This report is a 1/1 reproduction on the current cn-dev deployment. It does not claim reproduction on official main; that verification is still required.
Steps to reproduce
- Load the Jinpan
jinpan_001dataset into a multi-CN MatrixOne deployment. - Execute the
@q0261_payment_details_treestatement fromj_batch_014.sql, with the concurrent NESR writer enabled. - In the observed run, the statement started at
13:26:16.242 UTCand failed at13:26:16.625 UTC.
Actual behavior
The client received:
(20101, 'internal error: convert go error to mo error context canceled')
The same trace ID, 61cf8d08-9613-d1ec-213e-2f27969d0b3b, was present on participating CNs cn-rm8h5 and cn-5w5sf.
The first relevant server-side messages include:
the pipeline ... cannot execute remotely because its dispatch operator targets another local pipeline tree
shuffle pool was aborted before prepare completed
invalid state remote dispatch receiver ... is already closed
query interrupted
The failure then propagated to the client as context canceled.
Expected behavior
The valid statement should complete successfully, or return a specific, actionable execution error. A remote dispatch/shuffle topology inconsistency must not surface as the generic internal 20101 context canceled error.
Excluded causes
- Not a statement timeout: the run configured a 3600-second timeout and this statement failed in approximately 0.38 seconds.
- Not an OOM or process crash: no
OOMKilled, exit 137, panic, or fatal error was found in the event window. - Not CN lifecycle disruption: the two participating CNs had zero restart increments in the surrounding 10-minute window; no Draining, Pod deletion, or session migration event was recorded. The coordinator session logged
migrate-goRoutineId=0. - Not a runner disconnect: the runner reconnected and continued with later SQL files after this file was marked failed.
Evidence
- Workflow/job links above.
- Trace ID:
61cf8d08-9613-d1ec-213e-2f27969d0b3b. - Server timestamps:
2026-09-06 13:26:16.299–13:26:16.420 UTC.
Related
This is related in symptom to #27776 (remote work interruption), but the observed window contains no CN Draining/reclaim event, so it should be investigated independently.
Activity
[-][Bug]: distributed join aborts when remote dispatch targets another local pipeline tree[/-][+][Bug][cn-dev]: distributed join aborts when remote dispatch targets another local pipeline tree[/+][-][Bug][cn-dev]: distributed join aborts when remote dispatch targets another local pipeline tree[/-][+][Bug] dev:distributed join aborts when remote dispatch targets another local pipeline tree[/+]fix(dispatch): preserve terminal results for late remote receivers (#…
fix(temp): keep ALTER COPY DDL in executor transaction (#28356)
XuPeng-SH commentedon Sep 7, 2026
Root cause is now reproduced and a systematic fix is available in #28358.
The causal failure is a client-to-server MORPC stream sequence gap, not the placement-probing INFO message highlighted in the original report. Before the fix,
Stream.Sendconsumed a sequence at enqueue time. If that queued request was later skipped by the backend write loop because its context was canceled, its deadline elapsed, or a filter rejected it, the next live control frame arrived with a gap. The deterministic diagnostic capture waslast=1, current=3; the server correctly rejected that stream as protocol-corrupt and closed the session, which surfaced asrpc stream closed/ generic cancellation at SQL level.The
cannot execute remotely because its dispatch operator targets another local pipeline treemessage is reachable during normal placement probing and is not proof of this failure by itself.#28358 moves request sequence assignment to the single transport write loop after all skip checks, seals assignment on stream close, and uses an independent sequence lock so queue backpressure cannot deadlock against the lifecycle lock held during send admission. It is the client-request analogue of the server-response fix in #25811 and applies to pipeline chunks, batch ACKs, StopSending, FIN, and other stream frames without query-specific handling.
Validation on latest
main(fdc1e0ca8f): focused cancellation/filter/close/backpressure tests passed under race 100 times; the full MORPC race package, compile package, vet, and build passed; the existing real two-CNTestIssue28313EmptyRemoteDispatchpassed 10 final repetitions (and 50 repetitions during fix validation). The pre-fix stress reproduced the sequence gap andrpc stream closedlocally.fix(frontend): order composite lineage lifecycle locks (#28325)
fix(morpc): avoid client stream sequence gaps (#28358)
XuPeng-SH commentedon Sep 9, 2026
The #28447 UT Coverage failure is now correlated with this existing issue and the already-merged #28358 fix.
TestIssue28313EmptyRemoteDispatchshuffle target receiver ... was removed, data loss may occurafter MORPC stream closures.fix(morpc): avoid client stream sequence gaps) reached main.Current main contains merge commit #28358 and the exact regression test passed locally once on the current head (12.62s). The fix covers the transport sequence gap/lifecycle teardown path; this comment records the recurrence without opening a duplicate issue.
iamlinjunhong commentedon Sep 9, 2026
CI evidence for PR #28467, exact head
ab6165a9411fa0af90f2c118cda2a013475e1a63(branchm-28451):Stable BVT signature from the complete failed job log and execution artifact:
The Coverage job did not report an independent product failure. Its prerequisite gate failed with:
Attribution evidence:
shuffle target receiver ... was removed, data loss may occurfailure class tracked by this open issue. The existing maintainer analysis identifies the MORPC client-to-server stream sequence/lifecycle mechanism and links the systematic fix in fix(morpc): avoid client stream sequence gaps #28358.TestIssue28313EmptyRemoteDispatch.up/mainis91d7297f46a53797db28a5a6c1c71e45f84fa503and contains040356c3ab(fix(morpc): avoid client stream sequence gaps (#28358)). PR fix(mpool): avoid coverage crash in realloc failure test #28467 changes onlypkg/common/mpool/realloc_failure_linux_test.go; its dependency closure does not touch MORPC, shuffle/remote-dispatch code,comprimary_key.sql, or the CI harness.matrixone_testcoverage runs, the owningpkg/common/mpoolpackage test, focused race test, and vet. The existing CI UT/coverage producer, shared build, SCA, and Ubuntu/x86 UT checks also passed in run 34306143038.Reproduction: run the multi-CN compose pessimistic BVT suite at the exact head above, then inspect
test/distributed/cases/ddl/comprimary_key.sqlrow 34 and the execution report; the single failed assertion produces the signature above and reduces the required success rate from 100% to 99%.This occurrence is being added to the existing open issue rather than creating a duplicate. Per the approved CI intake standard, after this evidence is recorded only the failed jobs of run 34306143038 will be rerun once.
fix(logservice): retry transient HAKeeper backend closures (#28453)
22 remaining items
fix(temp): keep ALTER COPY DDL in executor transaction (matrixorigin#…
fix(frontend): order composite lineage lifecycle locks (matrixorigin#…
fix(morpc): avoid client stream sequence gaps (matrixorigin#28358)
fix(logservice): retry transient HAKeeper backend closures (matrixori…
fix(dispatch): preserve terminal errors on receiver retirement (matri…
fix(shuffle): guard stop writing by pool ownership (matrixorigin#28964)
XuPeng-SH commentedon Sep 22, 2026
Current status on main 3727c5c: the real two-CN TestIssue28313EmptyRemoteDispatch did not reproduce in one focused run followed by a bounded 3-run repetition. Current main contains the three identified fixes: #28358 (MORPC request sequence assignment), #28539 (remote receiver terminal/error ownership), and #28964 (shuffle stopper admission ownership). This is evidence that the exact regression is currently passing, not proof that every historical intermittent cross-CN recurrence is resolved. I am keeping the issue open. A further production patch needs a post-fix reproduction or lifecycle trace that identifies a still-broken invariant, such as unique receiver-generation terminal ownership, preservation of the root error during cleanup, success cleanup not becoming peer cancellation, or failed admission not participating in completion accounting.
XuPeng-SH commentedon Sep 22, 2026
Added deterministic post-attachment white-box coverage in #29224. The test drives the real
PrepareDoneNotify -> Dispatch.Call attachment -> local cancellation -> Dispatch.Reset terminal -> registration cleanuppath. It proves that empty input remains a remote success and an injected duplicate-key root error is not replaced by local cancellation after attachment. A temporary mutation restoring the bad dependency ondispatchProc.Ctxmade both cases fail immediately; the clean candidate passes normal/race repetitions and the real two-CN regression. This is additional lifecycle proof, not a claim that the test executes the dedup join operator itself.test(compile): cover attached remote terminal cleanup (#29224)
Ariznawlll commentedon Sep 27, 2026
测试版本
5be6cd90b501da225be591ffffe6000bf01f515e原问题验证
执行
TestIssue28313EmptyRemoteDispatch,覆盖远端 dispatch 目标为空时的分布式 join/pipeline 调度路径。该测试在最新 main 上连续执行 3 次,均未再出现 remote dispatch 中止或查询异常。Happy Path 覆盖
Unhappy Path 覆盖
白盒验证
040356c3aba7c38e54778af701eaf0cb6f1745d2、fb214b2d3c5624eeeb161d69123eea15d3110854、26fa8c369915cdfdeb4f4af7cf253869d2340b86、11914ae308d2ff9bcbf9fe0adba475a3276cbf32。回归测试
TestIssue28313EmptyRemoteDispatch -count=3:3/3 通过。测试证据
ok测试结论
测试通过。