Repository navigation
Description
Issue
In the nightly big-data regression, the Hive Partition test (29_external_hive_partition_agg_join.sql) fails with 4 consecutive 1800s query timeouts. CN server logs reveal a cluster-wide communication cascade failure: all 3 CN pods become simultaneously unresponsive to both client connections and internal CN-to-CN RPCs.
This is not the 30s dispatch registration timeout described in #25816 — that diagnosis was based on code analysis without CN server logs. The actual root cause is resource exhaustion from Hive external scan across 2000 parquet partitions.
Environment
| Field | Value |
|---|---|
| CI Run | https://github.com/matrixorigin/mo-nightly-regression/actions/runs/29764908174/job/88444199451 |
| Branch | main |
| MO commit | 0102f7b85bcb8d960d7cc16a14b71682a58e7910 |
| Namespace | mo-big-data-commit-0102f7b-suite-1y |
| Cluster | TKE, 3 CNs + 1 DN + 3 Log + 2 Proxy |
| CN memory limit | (standard big-data config) |
| Error window | 2026-07-20 19:51–21:54 UTC |
Failure Timeline
Client-side (runner log)
| Time (UTC) | SQL | Duration | Result |
|---|---|---|---|
| 19:52:04 | 4 simple aggregations on fact_hive_2000 |
300ms–1.2s | ✅ |
| 19:52:06 | EXISTS subquery (fact + dim JOIN) | 106s | ✅ (slow but passed) |
| 19:52:06 → 20:23:53 | fact JOIN dim (the primary failure) | 1800s | ❌ timeout |
| 20:23:53 → 20:53:53 | fact self-JOIN (cascade) | 1800s | ❌ timeout |
| 20:53:53 → 21:23:53 | UNION ALL partition count (cascade) | 1800s | ❌ timeout |
| 21:23:53 → 21:53:53 | GROUP BY + ORDER BY + LIMIT (cascade) | 1800s | ❌ timeout |
The primary failure SQL:
SELECT d.part_name, count(*) as rowcount
FROM external_hive_partition_2000_large.fact_hive_2000 f
JOIN external_hive_partition_2000_large.dim_part_2000 d ON f.part_id = d.part_id
WHERE d.part_id in (1, 7, 2000)
GROUP BY d.part_name ORDER BY d.part_nameServer-side (CN Loki logs)
All 3 CN pods became simultaneously unresponsive:
| CN Pod | IP | First i/o timeout | Memory Peak |
|---|---|---|---|
| tp-cn-trrnj | 10.143.132.177 | 19:51:04 (before JOIN started!) | 26.9 GiB |
| tp-cn-v89m9 | 10.143.132.176 | 19:51:54 | 17.1 GiB |
| tp-cn-sj7tp | 10.143.132.175 | 19:52:21 | 16.3 GiB |
Key observations from CN logs:
-
i/o timeouts started BEFORE the JOIN query — CN trrnj showed timeouts from 19:51:04, while the JOIN query was submitted at 19:52:06. The EXISTS subquery (106s) was already stressing the cluster.
-
All inter-CN communication failed simultaneously:
- trrnj → sj7tp:6002 (cn-backend):
use of closed network connection - trrnj → v89m9:6002:
use of closed network connection - sj7tp → trrnj:6001:
i/o timeout - v89m9 → sj7tp:6001:
i/o timeout - Both proxy pods also failed to reach any CN on port 6001
- trrnj → sj7tp:6002 (cn-backend):
-
CN sj7tp table statistics collector completely stuck:
WARN mo.table.stats.task "waited err another 30s" total=103 left=103Repeated every 30 seconds — 103 statistics tasks all failing.
-
Empty messageBoard (19:58:53 on sj7tp):
WARN "waiting message timeout, waiting for tag [1], messageBoard length: 0"Dispatch messages from other CNs never arrived.
-
No
dispatch process not registered within 30serrors anywhere in any CN log during the entire window. -
S3 slow events on Hive partition files:
slow event: S3FS.Read hive_partition/types_2000_large/part_id=1870/data.parquet -
Memory: CN trrnj spiked to 26.9 GiB (from ~19 GiB baseline). Other CNs at 15-17 GiB. Not at limit but the spike correlates with the failure.
Root Cause
The Hive external scan across 2000 parquet partition files (path: hive_partition/types_2000_large/part_id=*/data.parquet) consumes so many goroutines, S3 connections, and CPU cycles that the CN cannot service any other work — including internal CN-to-CN RPC (port 6002), client connections (port 6001), and health checks.
When the fact/dim JOIN triggers a cross-CN shuffle, all 3 CNs try to scan partitions and shuffle data simultaneously. The combined load overwhelms all CNs at once, creating a cascade where no CN can respond to any other CN, causing the query to hang indefinitely until the client-side 1800s timeout.
The 3 subsequent timeouts are cascading effects: func_timeout returns control to the runner without proving the server-side query was cancelled, and the runner reuses the same connection/cursor on a still-overloaded cluster.
Why This Is Not #25816
| Aspect | #25816 hypothesis | This issue (CN log evidence) |
|---|---|---|
| Core error | dispatch process not registered within 30s |
Not present in any CN log |
| Failure trigger | Receiver registration slower than 30s watchdog | Hive 2000-partition scan exhausts CN resources |
| Timing | After query dispatch | Before the failing query even starts |
| Scope | Specific remote dispatch path | All CN-to-CN and client-to-CN communication |
| Evidence basis | Code analysis without CN logs | Actual CN Loki logs from the failing run |
The original #25816 diagnosis explicitly noted: "The latest runner log does not expose the inner 30-second dispatch error... CN logs and a query profile are still required for that run." — the CN logs were never checked until now.
Suggested Investigation
- Hive external scan concurrency: The 2000-partition scan likely opens 2000 S3 reads concurrently. Add partition-level concurrency limits or batching.
- CN resource isolation: Hive external scan goroutines should not starve internal RPC handlers. Consider separate goroutine pools or priority scheduling for cn-backend (port 6002) traffic.
- Query-level timeout: Add a server-side query timeout (e.g., 300s for big-data queries) so that hung queries are cancelled server-side instead of relying solely on client-side timeout.
- Client cleanup: After
func_timeout, the test runner should cancel the server-side query and create a fresh connection before executing the next statement, to prevent cascade timeouts.
Affected Test
- Test file:
cases/big_data_test/04_QUERIES/29_external_hive_partition_agg_join.sql - Intermittent: yes — the same test passes on some runs when the cluster is less loaded
Activity
Ariznawlll commentedon Jul 21, 2026
Correction: Relationship with #25816
After checking the CN logs from the July 15 run (29428464735, the run documented in #25816 comment), I found that both errors co-exist in that run:
remote receiver not ready within 30s, remote CN may have failed— appeared on CN6z9skat 17:51:42 UTC (the error described in [Bug] 30s remote dispatch watchdog can falsely fail slow receiver registration #25816)The July 20 run (
0102f7b) does NOT show the 30s error because that commit already includes #25820 (the lifecycle-driven fix). The 30s watchdog no longer fires, but the underlying CN resource exhaustion from Hive 2000-partition scans is still present — it just manifests as indefinite hang instead of the explicit 30s error.Correct relationship:
#25816's diagnosis was not wrong — the 30s timeout IS a real symptom. But it is a cascading effect of the CN resource exhaustion, not an independent issue. The #25820 fix correctly removed the false-positive 30s error, but did not fix the underlying Hive scan resource problem, which is what this issue tracks.
Ariznawlll commentedon Jul 21, 2026
由原issue跟踪
Ariznawlll commentedon Jul 21, 2026
最小复现脚本
不需要重新准备数据,直接用现有的 Hive 表
external_hive_partition_2000_large.fact_hive_2000。在 TKE 集群的 runner 上运行:
判断标准
注意事项
Ariznawlll commentedon Jul 21, 2026
小数据量复现测试
原始问题是 2000 个分区导致 ~2000 个并发 S3 读取压垮 CN。不确定更少分区是否也能触发。
下面这个脚本可以用不同分区数测试,找到最小可复现的阈值:
预期结果
跑完后可以确定最小可复现的分区数,后续验证就用这个数,跑得更快。