Repository navigation
Description
Description
In the normal main TKE TPCC 1000 warehouses / 1000 terminals workload, several independent STOCK_LEVEL requests received ErrorCode: 20502, backend connection closed. Server logs show a five-second failure while a TP CN creates a pipeline MORPC backend to another live TP CN. The incident also affected CN heartbeat, lockservice, task service and log-service requests in the same time window.
Environment
- Branch:
main - MatrixOne commit:
c61ed374a8a6daebc4e753a928cb63c584addb4c - Workflow revision:
dff1aaab05bd3cca5b2b7aa34c69d01f888ac62a - Deployment: TKE distributed topology, 3 TP CNs, 1 DN, 2 Proxies
- Namespace:
mo-main-commit-c61ed374a8-20260914 - Failing job: https://github.com/matrixorigin/mo-nightly-regression/actions/runs/34860226012/job/104088638008
- Failure timestamp: 2026-09-14 18:37:13 UTC
Steps to reproduce
- Deploy the above main commit using the TKE nightly distributed topology.
- Prepare TPCC data for 1000 warehouses.
- Run the 1000-terminal TPCC transaction phase for five minutes with the standard regression workload mix.
- Preserve all TP CN, DN, LogService and Proxy logs from at least 60 seconds before the first client error through recovery.
Actual behavior
The 1000-terminal phase started at 18:36:57. The following service degradation preceded the client-visible SQL failures:
18:37:01 tp-cn-jqkcn (10.143.100.107): CN heartbeat -> context deadline exceeded
18:37:05 tp-cn-59s9b: lockservice failed to validate transactions -> backend connection closed
18:37:08 tp-cn-drn42: remote unlock / ISCP transaction finish -> context deadline exceeded
18:37:10 log-2: query cron task -> context deadline exceeded
18:37:13 tp-cn-59s9b pipeline client -> 10.143.100.107:6002
backend auto-create waited 5.000s
dial tcp4 10.143.100.107:6002: i/o timeout
18:37:13 five TPCC STOCK_LEVEL executions return 20502 backend connection closed
18:37:24+ tp-cn-jqkcn: task SQL, logger writes and frontend sessions -> context canceled / routine closed or busy
The exact server-side request failure was logged at process/process.go:766 as Failed to newMessageSenderOnClient sql=execute __mo_stmt_id_24, err=backend connection closed; __mo_stmt_id_24 is the TPCC STOCK_LEVEL query against bmsql_stock. The initiating MORPC error was:
auto-create backend timed out: waited=5.000072847s timeout=5s
dial tcp4 10.143.100.107:6002: i/o timeout
connect to remote failed: rpc timeout
The client recorded exactly five unexpected STOCK_LEVEL failures at the same second. The workload completed its five-minute duration, but the runner correctly failed because benchmarksql-error.log contained those unexpected database errors.
Expected behavior
A supported TPCC 1000-terminal workload must not expose internal cross-CN MORPC connection creation/timeout failures as 20502 to client transactions. A transient slow connection or a delayed peer must be bounded and recovered/isolated without cancelling unrelated in-flight TPCC requests.
Stability and controls
- Reproducer observed:
1/1run so far. Repetition is required to establish rate and commit range. - Controls in the same job passed: TPCC 10W/10T, 10W/100T, 100W/100T and 100W/1000T.
- TPCC consistency verification completed successfully after the failing phase; no persistent data inconsistency was found.
- Pod restart count was zero for all TP CNs in the incident window. No OOM event or CPU CFS throttling was observed.
Evidence
- Client errors: five
STOCK_LEVELrequests at18:37:13, each with20502 backend connection closed. tp-cn-59s9bcould not establish a MORPC pipeline backend totp-cn-jqkcn:6002within five seconds.- The same window contains independent lockservice, taskservice, CN-heartbeat and LogService deadline errors, so this is not a malformed TPCC statement or a test assertion issue.
tp-cn-jqkcnhad many FileService S3 read slow events around the onset (roughly 0.8-2.2 seconds). This is correlation only, not a confirmed root cause.
Code analysis
This is related by symptom, but not proven duplicate of #26475. #26475 was fixed by #26473 and that merge is already contained in c61ed374. The previous incident was a lockservice local backend-create timeout at a 500 ms boundary; this incident is a five-second pipeline-client dial timeout to port 6002 during query execution. The current failure may therefore be an uncovered MORPC/pipeline availability path or a new regression.
The direct initiating component is still unproven: the evidence does not distinguish a delayed/unavailable tp-cn-jqkcn listener, network-path disruption, FileService-induced service stall, or another MORPC lifecycle transition.
Regression coverage
The TKE nightly TPCC 1000W/1000T case already detects this failure. After a product fix, rerun this same workload repeatedly and require zero 20502, zero CN heartbeat/lockservice timeout burst, and a successful consistency check. Preserve per-CN MORPC backend-create/connection metrics and logs for any recurrence.
Related
- [Bug] TPCC 1000w/1000t: lockservice 'failed to lock on remote: backend connection closed' during startup #26475 — similar TPCC 20502 symptom; closed after fix: stabilize lockservice RPC lifecycle under CI load #26473, but different timeout/path
- fix: stabilize lockservice RPC lifecycle under CI load #26473 — lockservice RPC lifecycle fix already contained in the tested commit
- [Bug]: lockservice 10s backend read timeout cancels valid long-running lock RPCs and all shared streams #26090 — related MORPC timeout/connection-wide cancellation design issue
- [Bug]: Restore and clone follow-up TPCC loses multiple backend connections in synchronized bursts #28080 — synchronized post-restore/clone connection-loss bursts; different trigger
Activity
daviszhen commentedon Sep 15, 2026
Follow-up analysis: confirmed failure path and next actions
I correlated the issue evidence, the exact code at
c61ed374a8, the raw TPCC job log, related incidents, and the previous successful nightly.Confirmed failure path
tp-cn-59s9btried to create a Pipeline MORPC backend totp-cn-jqkcnat10.143.100.107:6002.dial tcp4 ... i/o timeout.TimeOutForEachConnectvalue for the transport connect timeout and backend auto-create wait budget. The default is five seconds. Consequently, one full-length dial can consume the complete recovery budget, leaving no meaningful second attempt:matrixone/pkg/cnservice/cnclient/types.go
Lines 27 to 35 in c61ed37
matrixone/pkg/cnservice/cnclient/client.go
Lines 58 to 68 in c61ed37
matrixone/pkg/common/morpc/backend.go
Lines 1186 to 1242 in c61ed37
matrixone/pkg/common/morpc/client_gc.go
Lines 397 to 427 in c61ed37
ErrBackendCreateTimeoutcurrently reusesErrBackendClosed, so the specific pre-dispatch creation timeout is flattened into client error 20502:matrixone/pkg/common/morpc/client.go
Lines 134 to 138 in c61ed37
NewStream, beforesendPipeline, so this remote scope had not yet sent its execution payload:matrixone/pkg/sql/compile/remoterunClient.go
Lines 94 to 123 in c61ed37
The job completed 147,106 transactions with exactly five errors and then passed consistency verification. This bounds the observed impact to transient availability; there is no data-corruption evidence.
Root-cause assessment
The immediate TCP connect failure is proven. The component that first caused it is not.
The strongest current classification is a transient target-CN/node/network liveness degradation. CN heartbeat, lockservice, remote unlock, task service, and LogService deadlines occurred in the same window, so this is not a malformed STOCK_LEVEL statement or a prepared-statement defect.
The leading product-level hypothesis to test is Pipeline connection/session pressure at the target listener or node network stack:
MaxSenderNumberremains 100,000;This is a hypothesis, not a proven root cause. FileService S3 slow reads may amplify general resource pressure, but user-space S3 latency does not directly explain a TCP handshake timeout without an intermediate mechanism such as listener backlog saturation, FD pressure, scheduler/resource starvation, or network packet loss.
This also does not currently look like a direct new MORPC behavior regression. The previous day's identical 1000W/1000T step passed on
a68a200c0bfb0c18f1b7f49d26b20b8d0d9b017f:https://github.com/matrixorigin/mo-nightly-regression/actions/runs/34764591964/job/103766317397
Between that revision and
c61ed374a8, the only MORPC production-code change was #28697, which added the underlying connect error to the terminal log and explicitly preserved propagation/retry behavior. One passing run and one failing run are insufficient to establish a regression range.Next actions
Prove or reject create-state fan-out. For the incident/reproduction window compare:
mo_rpc_backend_auto_create_timeout_total{name="pipeline-client"}mo_rpc_backend_auto_create_timeout_event_total{name="pipeline-client"}A delta of five request timeouts versus one distinct event would confirm one backend creation failure affected five waiters.
Capture the missing target-side evidence at one-second resolution:
mo_rpc_server_session_size{name="pipeline-server"}mo_rpc_backend_pool_size{name="pipeline-client"}mo_pipeline_stream_connection{type="living"}ListenOverflows/ListenDrops,SYN_RECV, ESTABLISHED and TIME_WAIT socketsReproduce on both the exact SHA and latest main. Run the same 1000W/1000T stage repeatedly;
1/1establishes the incident but not its rate. Preserve source/target CN identity and the first server-side transition for every failure.Product hardening after evidence:
Acceptance: repeated 1000W/1000T runs with zero unexpected 20502, bounded Pipeline connection/session counts, no listener overflow/drop burst, successful consistency checks, and a fault-injection case showing that a delayed/unreachable
:6002endpoint terminates or recovers within a bounded contract without cancelling unrelated work.Related capacity/lifecycle history: #25690, #25691, and #25713. This incident remains distinct from #26475, whose initiating failure was a 500 ms lockservice backend-create path rather than a five-second Pipeline TCP dial.
daviszhen commentedon Sep 15, 2026
TPCC rerun results
We reran
.github/workflows/nightly-regression-tke-new.yamlwithTest_list=tpcc,Repo=matrixorigin/matrixone, noCommit_BatchorConcurrent_Test_List, and kept the runs serialized by the workflow concurrency group.Exact incident commit
c61ed374a8a6daebc4e753a928cb63c584addb4cwas run three times. All three runs completed successfully, and thetpcc1000.1000target stage passed:06:57:34–07:04:24 UTC08:03:09–08:09:35 UTC09:03:22–09:09:49 UTCMain control runs
The three runs were dispatched with
Branch=mainas requested. Sincemainadvanced during the sequence, they did not all use the same commit:b347a62a30719cf3f2c8ca5a2da0dcfb11639f8c; target stage passed, overall run passed.b347a62a30719cf3f2c8ca5a2da0dcfb11639f8c; target stage passed, but the overall run failed in the post-test result checker because the10x10tpmC baseline check reported3556.34versus4903.89previously (more than 25% lower). This was not atpcc1000.1000load failure or a20502 backend connection closedfailure.20937392e1b9e951ebc40268e31b61a854cab09f; target stage passed, overall run passed.Conclusion
The original
c61ed374run reproduced the workload successfully in all three attempts. The issue's reported cross-CN Pipeline/MORPC timeout and client-visible20502error were not reproduced in these reruns. The target1000W/1000Tstage completed successfully in all six runs.The GitHub workflow evidence artifacts and run logs are retained with each run. CN/network/MORPC time-series metrics were not exported as a separate Grafana snapshot in this rerun, so the absence of a reproduced failure should not be interpreted as proof that the underlying transient trigger is impossible.
For a strict main control, the next comparison should pin one exact main SHA for all three repetitions instead of using the moving
mainbranch.fix(cnservice): preserve pipeline connect retry budget (#28922)
daviszhen commentedon Sep 16, 2026
回归测试
Ariznawlll commentedon Sep 16, 2026
观察几天
fix(cnservice): preserve pipeline connect retry budget (matrixorigin#…
fix(cnservice): preserve pipeline connect retry budget (matrixorigin#…
Ariznawlll commentedon Sep 18, 2026
结论:通过,Issue 可关闭。
修复提交 9d5cc76(PR #28922)已于 2026-09-15 合入 main。该修复将 Pipeline 单次 TCP 连接超时与总 backend-create/retry 预算分离:单次连接按 1 秒尝试,但仍受原有 5 秒总预算约束,因此第一次 dial 超时不会耗尽全部重试机会并直接向 TPCC 返回 20502。PR 同时加入了首个 dial 超时、后续重试成功的回归测试。
修复后的 main TKE TPCC 1000W/1000 terminals 已连续两轮通过,且所用 MatrixOne commit 均包含该修复:
76e1a9b:TPCC 1000W/1000 terminals 通过,tpmC=4749.17,一致性校验通过。6690f1a:TPCC 1000W/1000 terminals 通过,tpmC=4246.67,一致性校验通过。两轮目标阶段均未再出现
20502 backend connection closed。原始故障涉及的目标 CN/节点网络或监听端瞬态退化没有被单独复现和归因;若后续出现新的跨 CN dial 超时,应以新的环境证据单独跟踪。