Repository navigation
Description
Environment
| Field | Value |
|---|---|
| Cluster / namespace | mo-stb-4-2-dev-fa6c57c-202608041202 |
| Build / image | matrixone:commit-c8dae1d45 |
| Endpoint | 10.222.6.255:6001 |
| Artifact | /data1/stability-test/30876385810_fa6c57c |
| CN pod | stability-regression-dis-tp-cn-gndpr |
| Incident time | 2026-08-07 09:31:26 CST / 01:31:26 UTC |
| Container exit | Exit Code 1 (Last State: Terminated / Reason: Error) |
Summary
On a long-run soak, CN process self-terminated after logging:
level=FATAL msg="context deadline not set"
Root path: a Delete pipeline reached Engine.loadDatabaseFromStorage / getOrCreateSnapPartBy, then txnOperator.validate found a context without deadline and called MOLogger.Fatal, killing the whole CN (not a recovered frontend panic).
Clients saw a short burst of 2013 / 20702 at the same second; TPCC consistency continued PASS after the pod restarted. This is still a process-killing defect: a missing deadline must not Fatal the CN.
Expected vs actual
| Expected | Actual |
|---|---|
| Missing / unset ctx deadline returns a normal error or uses a bounded internal ctx | CN logs FATAL and exits (code 1) |
| Catalog/snap load failure stays on the SQL path | Entire CN pod recycled; proxy routes fail briefly (no available CN / transfer failure) |
Evidence
K8s
Last State: Terminated
Reason: Error
Exit Code: 1
Started: Thu, 06 Aug 2026 10:24:48 +0800
Finished: Fri, 07 Aug 2026 09:31:31 +0800
Restart Count: 2
Started (new): Fri, 07 Aug 2026 09:31:32 +0800
CN log (FATAL)
time=2026/08/07 01:31:26.503720 +0000
level=FATAL
msg=context deadline not set
caller=log/logger.go:149
Immediately before FATAL (same second):
engine.database.load.from.storage name=repro_ivfflat_bug
compile.table-scan.txn schema=mo_catalog table=mo_database txn-snapshot-ts=0-0
Stack (abbreviated)
pkg/common/log.(*MOLogger).Fatal logger.go:149
pkg/txn/client.(*txnOperator).validate operator.go:1639
pkg/txn/client.(*txnOperator).Debug operator.go:1433
pkg/sql/plan/function/ctl.init.func1 ctl/ctl.go:43
pkg/sql/plan/function/ctl.GetTNHandlerFunc ctl/dist.go:88
pkg/vm/engine/disttae.init.func1 disttae/db.go:482
pkg/vm/engine/disttae.(*Engine).getOrCreateSnapPartBy disttae/db.go:506
pkg/vm/engine/disttae.(*txnTable).getPartitionState txn_table.go:2588
pkg/vm/engine/disttae.(*txnTable).doRanges txn_table.go:1104
pkg/vm/engine/disttae.(*txnTable).Ranges txn_table.go:707
pkg/sql/compile.(*Compile).expandRanges compile.go:6469
… ParallelRun / MergeRun / RemoteRun …
pkg/vm/engine/disttae.execReadSql util.go:739
pkg/vm/engine/disttae.(*Engine).loadDatabaseFromStorage engine.go:358
pkg/vm/engine/disttae.(*Engine).Database engine.go:454
pkg/vm/engine/disttae.(*Transaction).getTable txn.go:1452
pkg/vm/engine/disttae.(*Transaction).resolvePKCheckPosForWrite txn.go:1487
pkg/vm/engine/disttae.(*Transaction).writeBatchWithAutoIncrEpochKnown txn.go:331
pkg/vm/engine/disttae.(*txnTable).writeTnPartition txn_table.go:2156
pkg/vm/engine/disttae.(*txnTable).Delete txn_table.go:2079
pkg/sql/colexec/deletion.(*Deletion).normalDelete deletion.go:247
pkg/sql/colexec/deletion.(*Deletion).Call deletion.go:91
… pipeline / Scope.Run / Compile.run …
Client (same second, CST)
2026-08-07 09:31:31 TPCC Communications link failure (2013-class)
2026-08-07 09:31:33 TPCH ERROR 2013 Lost connection during query
2026-08-07 09:31:44 TPCC ErrorCode 20702 lock table bind changed
Proxy at 01:31:32 UTC: route failed / failed to connect to backend / no available CN-class transfer errors.
Mechanism
DML Delete (vector / account workload)
→ writeTnPartition / resolvePKCheckPosForWrite
→ Engine.Database → loadDatabaseFromStorage (catalog snap path)
→ getOrCreateSnapPartBy → ctl/TN debug validate
→ txnOperator.validate: ctx has no deadline
→ MOLogger.Fatal ← process exit
Root cause
- Internal catalog/snap read during Delete uses a context (or txn debug/validate path) without a deadline.
txnOperator.validatetreats that as FATAL instead of returning an error to the SQL layer.- Result: one bad ctx → entire CN death, not a single-statement failure.
Proposed fixes
MO (primary)
pkg/txn/client/operator.go(validate~1639): do not Fatal on missing deadline; return error / log ERROR.pkg/vm/engine/disttae(loadDatabaseFromStorage/execReadSql/getOrCreateSnapPartBy): ensure internal reads use a bounded context (or inherit statement deadline).- Avoid calling
txnOperator.Debug/ ctl validate on hot Delete → catalog reload paths unless deadline is guaranteed.
Activity
[-]Bug] CN FATAL exit: `context deadline not set` in `txnOperator.validate` during Delete → loadDatabaseFromStorage[/-][+][Bug] CN FATAL exit: `context deadline not set` in `txnOperator.validate` during Delete → loadDatabaseFromStorage[/+]Ariznawlll commentedon Aug 17, 2026
测试版本
4.2-devaaac5956fdbcee0d43aed91c150fe3f2c05b90c1mo-stb-4-2-dev-aaac595-202608142318mo-chaos-4-2-dev-aaac595-202608161347原问题验证
当前 4.2-dev commit 已包含 #26894。对修复后的稳定性和 Chaos CN Pod 日志分别检查原错误签名:
context deadline not set:稳定性 0 次,Chaos 0 次panic::稳定性 0 次,Chaos 0 次原问题中 Delete / catalog snapshot 路径因 context 无 deadline 调用
MOLogger.Fatal、导致 CN 进程退出的现象未复现。Happy Path 覆盖
Unhappy Path 覆盖
task_kill_cn、task_kill_dn、CN/DN/LogService memory stress、CN/DN/LogService network chaos 均已重复执行至少 22 次;故障期间和恢复后均未出现context deadline not setFATAL。白盒验证
本轮为分布式长稳与 Chaos 黑盒复核,未额外执行白盒故障注入。#26774 已覆盖 transaction snapshot、statement context 传播及 canceled delete;#26894 将对应实现与回归测试回合到 4.2-dev。
回归测试
测试证据
mo-stb-4-2-dev-aaac595-202608142318mo-chaos-4-2-dev-aaac595-202608161347测试结论
测试通过。