Skip to content

[Bug] TPCC 1000W/1000T fails with CN i/o timeout under high memory pressure (recurrence of #24893) #25129

Closed

Description

@Ariznawlll

Issue

TPCC 1000 warehouses / 1000 terminals benchmark fails with ErrorCode: 20505 (i/o timeout) during the 5th test round when all CN pods reach peak memory (~46–49 GB).

This is a recurrence of the same failure pattern reported in #24893 (closed 2026-06-11).

Failed Run

Error

FATAL jTPCCTerminal:214 - [UNEXPECTED][TT_PAYMENT][EXECUTION] ErrorCode : 20505,
ErrorMessage : cannot connect to backend: writeto tcp4 10.143.35.187:21928->10.143.35.185:6003:
read tcp4 10.143.35.187:21928->10.143.35.185:6003: i/o timeout
  • 88 occurrences of this error, 44 transaction errors
  • tpmE = 8.72, tpmC = 7001.16

Pod IP Mapping

Pod IP
tp-cn-qk2rd 10.143.35.185 (unresponsive CN)
tp-cn-xw7xl 10.143.35.187 (proxy/source CN)
tp-cn-zwjff 10.143.35.186

Root Cause Analysis

1. Memory Pressure

At the time of failure (TPCC round 5 peak), all 3 CN pods were at ~46–49 GB memory:

CN Memory at Error Peak
qk2rd (185) 46.2 GB 49.4 GB
zwjff (186) 46.4 GB 48.6 GB
xw7xl (187) 47.8 GB 48.4 GB

Memory oscillates with each TPCC 5-minute round — rises during the test, drops during transitions. The failure consistently occurs at the memory peak of rounds 4–5.

2. GC STW Pauses

CN Max GC Pause Risk
qk2rd (185) 363 ms High
zwjff (186) 125 ms Medium
xw7xl (187) 111 ms Medium

qk2rd's 363ms GC stop-the-world pause is sufficient to cause RPC timeouts under TPCC's tight concurrency. Note: Prometheus 1-minute sampling likely misses sub-second spikes — actual pauses may be longer.

3. Cascade Failure (Loki Logs at 18:48:45–46 UTC)

  • All CN backend connections (port 6002) between all 3 CNs dropped simultaneously: close tcp4 ... use of closed network connection
  • Multiple CNs reported cannot get salt, maybe not use proxy — client connection failures
  • zwjff reported sql: database is closed — database connection pool exhausted
  • log-1 reported context deadline exceeded + sql: database is closed
  • Both proxy pods (rxdrk, k9m9s) reported close connection failed

4. No OOM / No Restarts

  • 0 pod restarts
  • 0 OOMKilled events
  • CN processes remained alive, just unresponsive during GC pauses

Causal Chain

TPCC round 5 (1000W/1000T) peak
  → All CNs at ~46-49 GB memory
  → qk2rd (185) GC STW pause ≥363ms
  → qk2rd cannot respond to lockservice/morpc backend RPCs
  → xw7xl (187) times out connecting to qk2rd:6003 → "i/o timeout"
  → Proxy cannot forward client requests → ErrorCode 20505
  → TT_PAYMENT transactions fail, tpmE=8.72

Recurrence Pattern

The same error pattern repeats every ~4 hours in this namespace (18:48, 22:48, 02:48 UTC), consistently at TPCC 1000W peak rounds. This is not a one-time flaky failure.

Comparison with #24893

Aspect #24893 (June 8) This issue (June 23)
Scenario TPCC 1000W/1000T TPCC 1000W/1000T
Error i/o timeout, ErrorCode 20505 i/o timeout, ErrorCode 20505
Root cause High memory → GC → CN unresponsive High memory → GC → CN unresponsive
Status Closed 2026-06-11 Recurred 2026-06-23

Suggested Investigation Areas

  1. Memory reduction: 48 GB/CN is excessive for TPCC 1000W — investigate mpool management, buffer pool sizing, and object allocation patterns
  2. GC tuning: Consider GOGC adjustment, SetMemoryLimit, or reducing short-lived object allocation rate
  3. RPC timeout tolerance: 363ms GC pause should not cause connection drops — increase heartbeat/timeout thresholds for internal CN-to-CN communication
  4. Workload distribution: Prevent all CNs from hitting memory peaks simultaneously

Environment

  • Kubernetes cluster: TKE
  • MO commit: 435e7da55
  • 3 CN pods, 1 DN pod, 2 proxy pods, 3 log pods

Activity

  1. added
    kind/bug
    severity/s0
    on Jun 25, 2026
  2. added theissue type on Jun 25, 2026
  3. added this to the MO-202606 milestone on Jun 25, 2026
  4. Ariznawlll commented on Jun 26, 2026

    @Ariznawlll
    CollaboratorAuthor

    Recurrence: 2026-06-25 sysbench1000w (main branch, commit 42280140b)

    CI Run: https://github.com/matrixorigin/mo-nightly-regression/actions/runs/28181428924/job/83525020923
    Namespace: mo-main-commit-42280140b-20260625

    Failed Test

    oltp_insert_duplicate (sysbench1000w), data prepare phase simple_insert_duplicate_10_10000000_prepare:

    ErrorCode : 20505
    ErrorMessage : cannot connect to backend: writeto tcp4 10.143.41.200:49012->10.143.41.198:6003: 
                   read tcp4 10.143.41.200:49012->10.143.41.198:6003: i/o timeout
    
    • 6 errors out of 1,073,847 total requests
    • RESULT: FAILED
    • Time: 21:06:05 UTC

    Context

    Same pattern as this issue — CN-to-CN RPC i/o timeout under sustained high-concurrency load. This was the 12th sysbench1000w test after ~70 minutes of continuous 1000-thread workload on a 3-CN cluster:

    CN Pod Connections at failure window
    tp-cn-w2rnk 1,541
    tp-cn-wxgr9 1,068
    tp-cn-4x5s4 976
    Total ~3,585

    Error occurred on port 6003 (lockservice/data transfer between CNs), identical to the TPCC failure in this issue. The preceding test (oltp_delete) also failed with error 20508 (all CN servers busy, see #25164), confirming the cluster was at connection saturation.

    This confirms error 20505 i/o timeout is not workload-specific — it reproduces across TPCC, sysbench update_pk (#25074), and sysbench insert_duplicate.

  5. modified the milestones: MO-202606, MO-202607 on Jun 30, 2026
  6. Ariznawlll commented on Jul 7, 2026

    @Ariznawlll
    CollaboratorAuthor

    New Recurrence: sysbench1000w oltp_read_write (4.1-dev)

    Environment

    Field Value
    Job SYSBENCH OLTP TEST 1000W
    Branch 4.1-dev
    Namespace mo-branch-commit-00d2f57ca-20260706
    Cluster TKE, 2 CNs + 1 DN
    CN memory limit 55 GiB
    Error time 2026-07-06 20:37:05 UTC

    Pod IP Mapping

    Pod IP
    tp-cn-0 (unresponsive) 10.143.72.191
    tp-cn-1 (proxy source) 10.143.72.192
    dn-0 10.143.72.189

    Error

    FATAL: mysql_drv_query() returned error 20505
    (cannot connect to backend:
     writeto tcp4 10.143.72.192:64318->10.143.72.191:6003:
     read tcp4 10.143.72.192:64318->10.143.72.191:6003: i/o timeout)
    

    200 FATAL errors all at exactly 20:37:05, all targeting CN 10.143.72.191:6003.

    Affected Queries

    All are UPDATE ... SET k=k+1 WHERE id=N across sbtest1-sbtest10:

    UPDATE sbtest1 SET k=k+1 WHERE id=2070768
    UPDATE sbtest1 SET k=k+1 WHERE id=2938593
    UPDATE sbtest1 SET k=k+1 WHERE id=3500128
    UPDATE sbtest2 SET k=k+1 WHERE id=7494865
    UPDATE sbtest3 SET k=k+1 WHERE id=916868
    UPDATE sbtest4 SET k=k+1 WHERE id=8278256
    UPDATE sbtest5 SET k=k+1 WHERE id=1428299
    UPDATE sbtest6 SET k=k+1 WHERE id=3889166
    UPDATE sbtest7 SET k=k+1 WHERE id=1248693
    UPDATE sbtest8 SET k=k+1 WHERE id=8815361
    UPDATE sbtest9 SET k=k+1 WHERE id=259544
    UPDATE sbtest10 SET k=k+1 WHERE id=7148196
    -- ... (200 total, across all 10 tables)

    Sysbench Command

    sysbench --mysql-host=172.16.70.124 --mysql-port=6001 --mysql-user=dump \
      --db-ps-mode=disable --mysql-ignore-errors=20701 \
      oltp_read_write.lua --mysql-db=sysbench_db \
      --tables=10 --table_size=10000000 --threads=1000 \
      --time=300 --report-interval=10 --point_selects=1 run

    TPS Timeline

    [ 250s ] tps: 49162  lat(95%): 56ms    -- normal (point_select warmup)
    [ 260s ] tps: 46371  lat(95%): 65ms    -- normal
    [ 270s ] tps: 46092  lat(95%): 68ms    -- normal
    [ 280s ] tps: 46030  lat(95%): 66ms    -- normal
    --- read_write phase starts ---
    [ 10s  ] tps: 5      lat(95%): 9799ms  -- CN becoming unresponsive
    [ 20s  ] tps: 89     lat(95%): 19778ms -- 200 FATAL i/o timeout errors at 20:37:05
    

    Analysis

    Same pattern as the TPCC 1000W recurrence:

    1. High-concurrency write workload (1000 threads, oltp_read_write)
    2. CN 10.143.72.191 becomes unresponsive
    3. Proxy (10.143.72.192) cannot reach CN on port 6003 → i/o timeout
    4. All UPDATE queries fail with error 20505
    5. Latency spikes from ~66ms to ~19778ms before failure

    This confirms the issue is not specific to TPCC — it affects any high-concurrency write workload (sysbench oltp_read_write, TPCC new_order, etc.) on multi-CN clusters.

  7. Ariznawlll commented on Jul 9, 2026

    @Ariznawlll
    CollaboratorAuthor

    New Recurrence: sysbench1000w INSERT DUPLICATE KEY prepare (main)

    Environment

    Field Value
    Job SYSBENCH OLTP TEST 1000W
    Branch main (commit b9efcce)
    Namespace mo-main-commit-b9efcce38-20260709
    Cluster TKE, 3 CNs + 1 DN, 55 GiB memory limit
    Error time 2026-07-09 08:24:22 UTC

    Error

    334 Communications link failure errors during simple_insert_duplicate_10_10000000_prepare:

    TxnName: simple_insert_duplicate_10_10000000_prepare
    ErrorCode: 0
    ErrorMessage: Communications link failure
    The last packet successfully received from the server was 100,062 milliseconds ago.
    

    Root Cause: CN Memory Pressure

    All 3 CNs memory spiked to 44-47 GiB (~85% of 55 GiB limit) during the INSERT DUPLICATE KEY data preparation phase:

    CN stk5q:  35 GiB → 46.7 GiB (peak at 08:26)
    CN 5hbr6:  35 GiB → 46.4 GiB (peak at 08:20)
    CN hrxmr:  38 GiB → 47.3 GiB (peak at 08:22-08:24)
    

    Memory Timeline

    08:10-08:18  CN memory 35-38 GiB (normal)
    08:20        5hbr6 spikes to 46.4 GiB
    08:22        hrxmr spikes to 47.3 GiB
    08:22:42     INSERT DUPLICATE request sent
    08:24:22     100s timeout → Communications link failure (334 txns)
    08:25:59     morpc: dial tcp4: missing address
    08:26        stk5q peaks at 46.7 GiB
    08:28        Memory drops (prepare failed, load gone)
    

    Other Metrics

    • GC: Normal (p75 < 1.2ms) — not a GC pause issue
    • Pod restarts: None
    • Loki: dial tcp4: missing address on CN-to-CN RPC at 08:25:59 (consequence of CN unresponsiveness)

    Same Pattern as Previous Recurrences

    • High-concurrency write workload (INSERT DUPLICATE KEY, 1000 vusers)
    • CN memory spikes to ~47 GiB
    • CN becomes slow/unresponsive
    • Client 100s timeout
    • Communications link failure

    This confirms the issue is specifically triggered by heavy write workloads causing excessive CN memory usage.

  8. VioletQwQ-0 commented on Jul 15, 2026

    @VioletQwQ-0
    Collaborator

    PR #25178 added observability that can help analyze the next recurrence of this failure pattern.

    When a similar 20505, port 6003 i/o timeout, Communications link failure, or all-CN-busy event occurs, please capture a narrow window around the first client error and check:

    • mo_rpc_backend_error_total grouped by name, backend, phase, and error_type; focus on lock-client or lock-active-txn-client and the affected :6003 backend.
    • mo_lockservice_remote_rpc_error_total grouped by method and error_type.
    • Proxy CN health, all-busy, backend handshake latency, and handshake-inflight signals.
    • CN/DN memory and CPU together with mo_task_merge_oom_pause_total and mo_task_merge_available_memory_bytes.
    • The same signals from a successful run of the same workload for comparison.

    These metrics should help establish whether resource pressure, lockservice/MORPC failure, or Proxy rejection happened first. They are diagnostic signals rather than a root-cause fix, and wait_response counts represent affected requests, so phases should not be summed as unique transport failures.

    Queries and log filters are documented in docs/observability/mo-ci-regression-failure-queries.md.

  9. Ariznawlll commented on Jul 20, 2026

    @Ariznawlll
    CollaboratorAuthor

    New Recurrence: sysbench1000w read_write_1000 — error 20508 "all CN servers are busy" (4.1-dev)

    Environment

    Field Value
    Job SYSBENCH OLTP TEST 1000W
    Branch 4.1-dev (commit e15148a42)
    Namespace mo-branch-commit-e15148a42-20260718
    Cluster TKE, 3 CNs + 1 DN, 55 GiB memory limit, GOMEMLIMIT 25000 MiB
    Error time 2026-07-18 21:21:33 UTC

    Error

    FATAL: unable to connect to MySQL server on host '172.16.16.86', port 6001, aborting...
    FATAL: error 20508: all CN servers are busy, possibly due to too many active transactions
    FATAL: `thread_init' function failed: ./oltp_common.lua:356: connection creation failed
    

    All 1000 threads failed to initialize — read_write_1000 test could not start at all. This is a new error code (20508) compared to previous recurrences (20505 i/o timeout), but the root cause is the same: CN pods under high memory pressure cannot accept new connections.

    Pod IP Mapping

    Pod IP Peak Memory Peak Time
    tp-cn-vpdhq 10.143.125.185 47.6 GiB 21:23
    tp-cn-d276z 10.143.125.186 47.0 GiB 21:23
    tp-cn-9phcd 10.143.125.187 43.6 GiB 21:30
    dn-0 10.143.125.x 34.2 GiB 21:26

    Root Cause Analysis

    1. Memory Pressure

    All 3 CNs at 43.6–47.6 GiB (79–87% of 55 GiB limit) during the failure window. The read_write_1000 test was the 5th sysbench1000w test, and memory accumulated across preceding tests (point_select, read_only, random_points, random_ranges).

    2. GC STW Pauses

    gc 1494 @15982.369s 0%: 0.21+244+0.062 ms clock, 9756->9862->3509 MB, 11102 MB goal
    

    CN tp-cn-9phcd had a 244ms GC STW pause, consistent with previous recurrences.

    3. Connection Authentication Slowdown

    CN tp-cn-9phcd took ~2.4 seconds to authenticate each new connection (normal <10ms):

    Authenticate: 2.425s, CheckTenant: 2.420s, CheckUser: 1.13ms, CheckRole: 415µs
    

    4. DN OOM Alert

    DN triggered MergeExecutorEvent-PauseDueToOOMAlert with available-mem: 0 at 21:23:32.

    5. Proxy Connection Migration Cascade

    At 21:22:30–32, the proxy was massively migrating connections between CNs, but many migrations failed:

    "failed to migrate connection to cn, will retry"
    

    6. SQL Execution Slowdown

    Multiple queries taking >1 second on CN tp-cn-9phcd:

    "time of Exec.Run : 1.094s"
    

    Causal Chain

    sysbench1000w tests 1-4 accumulate CN memory to 43-47 GiB
      → GC STW pause ≥244ms on CN 9phcd
      → Connection authentication stalls to 2.4s/connection
      → 1000 new threads cannot connect within timeout
      → Proxy returns error 20508 "all CN servers are busy"
      → read_write_1000 test fails to start (0 results)
      → Cascading: update_pk test also regresses 31% (tps 3227 vs 4676)
    

    Comparison with Previous Recurrences

    Aspect Previous (20505 i/o timeout) This (20508 all CN busy)
    Error code 20505 20508
    Failure point Mid-test transaction failure Thread init — test cannot start
    Root cause CN unresponsive to internal RPC CN unresponsive to new connections
    Memory 46–49 GiB 43.6–47.6 GiB
    GC pause 125–363ms 244ms
    DN impact — OOM alert, merge paused

    Error 20508 is a more severe manifestation: the CN pods are so overloaded they reject connections at the Proxy level before any query can be sent.

    Additional Impact

    The second exit code in this job was a sysbench_update_pk performance regression:

    • tps = 3227 (vs previous 4676, -31%)
    • Likely caused by the same memory pressure carrying over from earlier tests
  10. XuPeng-SH commented on Aug 29, 2026

    @XuPeng-SH
    Contributor

    stale

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind/bugseverity/s0

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions