Skip to content

[Bug]: Restore and clone follow-up TPCC loses multiple backend connections in synchronized bursts #28080

Open

Description

@LeftHandCold

Is there an existing issue for the same bug?

  • I have checked the existing issues.

Branch Name

4.2-dev

Commit ID

dad3554830240904588d7c0a812f42142c791a9a

Other Environment Information

Actual Behavior

Restore/clone operations reached the follow-up TPCC phase, but multiple
independent jobs then observed clustered backend connection closures and
invalid MySQL connections. New connections subsequently recovered, and every
available TPCC consistency check passed.

This is a transient availability failure, not evidence of persistent TPCC data
corruption.

1. SYS RESTORE NONSYS TO NEWNONSYS

Job:
https://github.com/matrixorigin/mo-nightly-regression/actions/runs/33683918110/job/100448321487

TPCC session: 2026-09-02 23:01:22 - 23:03:33 UTC
2026-09-02 23:02:23 - 23:02:38:
  15 TT_NEW_ORDER requests:
  The connection[...] has not been valid,
  caused by: Communications link failure

Transaction Error = 15
Measured tpmE = 6.86
2026-09-02 23:04:48:
  Consistency verification successfully.

The failures arrived as one burst across many unrelated connection IDs rather
than as one isolated bad session.

2. NONSYS RESTORE NONSYS

Job:
https://github.com/matrixorigin/mo-nightly-regression/actions/runs/33683918110/job/100457337320

First TPCC session: 2026-09-03 00:02:01 - 00:04:10 UTC
2026-09-03 00:03:01 - 00:03:36:
  16 TT_NEW_ORDER connection failures

Transaction Error = 16
Measured tpmE = 7.42
2026-09-03 00:05:23:
  Consistency verification successfully.

Second TPCC session: 2026-09-03 00:06:30 - 00:08:32 UTC
Transaction Error = 0
Measured tpmE = 0.0
2026-09-03 00:09:39:
  Consistency verification successfully.

The successful second run proves that the cluster recovered without data
repair or recreation. It also rules out a permanently invalid restored
database as the complete explanation.

3. NONSYS CLONE DB AND TABLE TO NONSYS

Job:
https://github.com/matrixorigin/mo-nightly-regression/actions/runs/33683918110/job/100474527833

2026-09-03 00:31:53 - 00:32:16:
  10 STOCK_LEVEL requests failed with:
  ErrorCode 20502, backend connection closed

2026-09-03 00:32:47 - 00:32:58:
  3 TT_NEW_ORDER connections became invalid with:
  Communications link failure

Transaction Error = 13
Measured tpmE = 6.39
2026-09-03 00:35:41:
  Consistency verification successfully.

Current Classification

The observed availability defect is proven, but its internal root cause is not
yet proven.

What is proven:

  • failures occur in synchronized bursts across multiple client connections;
  • both backend connection closed and later invalid JDBC connections are
    visible;
  • the cluster accepts new work afterward;
  • consistency verification succeeds;
  • the problem repeats in more than one restore/clone follow-up TPCC job in the
    same run.

What is not yet proven:

  • which component first closed or stopped serving the connections;
  • whether Proxy closed backend connections, a CN listener/session was
    unavailable, or CN-to-CN RPC/lock traffic stalled first;
  • whether the trigger is restore/clone catalog pressure, resource pressure,
    lock contention, an MORPC generation transition, or another failure;
  • whether current main still reproduces the same failure.

This issue must remain separate from the concurrent CREATE/DROP ACCOUNT
regression. That issue has a proven global mo_view_refresh FOR UPDATE queue;
the evidence here does not establish that queue.

Relation to Existing Fixes

#26888 is symptom-related but not currently proven to be the same failure.
It covered a specific lock-client MORPC control-probe timeout and uncertain-lock
deadlock path, fixed by #26903 and #26925.

The affected 4.2-dev commit dad3554830 does not contain the main merge
commits for #26903 or #26925. Current main contains both fixes. Therefore:

  • those fixes are valid candidates for mitigating this 4.2 incident;
  • their presence in main is not sufficient proof that this complete
    restore/clone connection-loss pattern is fixed;
  • validation must rerun the same restore/clone TPCC jobs and correlate the
    first server-side connection transition.

Expected Behavior

After a successful restore or clone:

  • TPCC connections should remain usable under the supported concurrency;
  • one slow backend or RPC should not close unrelated client connections in a
    synchronized burst;
  • if a request cannot be served, it should receive a bounded database error
    and the client should be able to reconnect immediately;
  • consistency checks should remain successful.

Steps to Reproduce

1. Deploy the 4.2-dev distributed topology used by run 33683918110.
2. Execute each snapshot/restore or clone workflow.
3. Immediately run the workflow's concurrent TPCC phase.
4. Repeat the same TPCC phase once without another restore.
5. Preserve Proxy and all CN logs from 60 seconds before the first 20502 or
   connection-invalid error until 60 seconds after the last error.
6. Run the TPCC consistency checker after each attempt.

Required evidence for final root cause:

  • client connection ID and first failure timestamp;
  • Proxy frontend/backend connection IDs and close reason;
  • source and target CN UUIDs, MORPC backend generation, and original RPC error;
  • CN pod restart/readiness and listener state;
  • lockservice long waits/deadlock graph events in the same window;
  • CPU, memory, goroutine, file descriptor, network, and FileService latency;
  • exact statement/transaction IDs for at least one failed connection.

A valid fix must make the original failing run green or deterministically
change the first server-side transition while preserving consistency.

Additional information

Activity

  1. added
    kind/bug
    on Sep 3, 2026
  2. gouhongshen commented on Sep 3, 2026

    @gouhongshen
    Contributor

    Automated AI triage

    This issue requires human involvement and cannot currently be completed independently by the
    automated fix loop.

    Reason

    Distributed QA, CN/RPC and network owners must provide a retained/reduced current-build reproduction or synchronized endpoint listener, stacks and network-path evidence around the first failed dials. Those incident-state observations are unavailable from repository code.

    Evidence

    The nightly TPCC availability regression is evidenced, but the first observed mechanism is simultaneous RPC endpoint dial failure. No corruption, panic, OOM or unbounded hang is established, and the existing-fix audit found no demonstrated closure.

    Please use this analysis to provide the missing decision, environment, evidence, or ownership
    needed before the issue is returned to the AI candidate pool.

  3. LeftHandCold commented on Oct 7, 2026

    @LeftHandCold
    CollaboratorAuthor

    New first-event evidence for the restore/clone follow-up connection failures, from Main MO 5669b1683cf2188652c4ea56390e6a77ab5d13d8:

    Run: https://github.com/matrixorigin/mo-nightly-regression/actions/runs/37532875674

    The first correlated follow-up TPCC failure occurs at 2026-10-06 23:36:27.006 UTC / 2026-10-07 07:36:27.006 CST, on TP CN nightly-regression-dis-tp-cn-n2z5x, transaction 1cb826aa5d27b14c18dc10a3d090acad, executing the prepared STOCK_LEVEL statement. It returns 20502 backend connection closed.

    Importantly, the service-side failure starts before that SQL error:

    UTC Observation
    23:36:23.005 n2z5x cannot create a remote CN backend: TCP dial to CN port 6002 times out
    23:36:23.139 zkgxj has a corresponding dial timeout to another CN's port 6002
    23:36:23.166–23.186 n2z5x and 7q2cd report more CN-to-CN 6002 dial timeouts, involving all three CN endpoint addresses
    23:36:24.073 zkgxj reports automatic backend creation failure
    23:36:24.977 7q2cd also times out connecting to LogService port 32001 and polling CN schedule commands
    23:36:27.006 n2z5x's automatic backend creation fails, then the correlated TPCC SQL returns 20502

    This localizes the first observed mechanism to remote RPC backend creation / endpoint reachability, rather than merely an idle Proxy-to-MySQL connection being recycled. It is not evidence of checkpoint corruption or wrong restored rows.

    Checks around 23:33–23:38 UTC:

    • All three CN pods remained Running; recorded container restart counts were zero. No corresponding OOM event or deletion timestamp was found.
    • Workflow cleanup ran only at 2026-10-07 00:54:27–00:56:45 UTC, well after these failures, so this run's cleanup does not explain the first connection failures.
    • Node conntrack usage was approximately 500–1,300 entries against a 1,048,576-entry limit; exported listen-drop/overflow counters did not increase. This does not support conntrack-table exhaustion or observed TCP listen-queue overflow.
    • CN CPU was busy, but the evidence does not prove that CPU saturation caused the failed dials. Pod Ready/Running does not prove the RPC endpoint was responsive.

    The earlier SYS-path no available CN server at 22:18:34 UTC is a separate first event and should not be merged into this later TPCC chain without evidence.

    Still unknown: why several remote endpoints stopped answering new RPC connections in this interval. We need endpoint listener/network-path evidence to distinguish CN/RPC responsiveness from node/CNI/storage-related disruption. The logs establish the connection-failure mechanism, not an external-network root cause or a specific introducing PR. This comment adds evidence to the existing issue instead of filing another generic backend-closure bug.

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

Metadata

Metadata

Assignees

Labels

deferredkind/bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions