Skip to content

[Bug]: indexed cloned table DELETE 10M rows hangs for over 1800s on main #26057

Closed

Description

@Ariznawlll

Environment

Problem

A conditional DELETE of 10 million rows from a 100-million-row cloned table did not finish within 1800 seconds. The same statement completed in approximately 15–17 seconds in the two previous successful baselines.

This is the first real failure in the DML case. The UPDATE statements before it completed successfully. After the first timeout, the regression runner reused the same cursor/connection, so every later statement timed out at exactly 1800 seconds; those later UPDATE failures are downstream effects and should not be treated as independent UPDATE-engine failures.

Table definition

create table big_data_test.table_with_pk_index_for_write_100M(
  id bigint primary key,
  col1 tinyint,
  col2 smallint,
  col3 int,
  col4 bigint,
  -- other columns omitted
  key(col3),
  unique key(col4)
);

The test creates independent clones before executing DML:

create table if not exists big_data_test.table_with_pk_index_for_write_100M_copy03
clone big_data_test.table_with_pk_index_for_write_100M;

First failing SQL

delete from big_data_test.table_with_pk_index_for_write_100M_copy03
where id <= 10000000;

Timeline in CST:

  • 04:04:18: DELETE started
  • 04:34:18: runner reported Execution timeout after 1800s
  • No MatrixOne SQL error was returned to the client before the timeout.

Same-run DML timing

Statement Result Cost
UPDATE 1M rows success 27.2s
UPDATE 10M rows success 95.9s
UPDATE all 100M rows success 250.9s
DELETE 1M rows success 16.9s
DELETE 10M rows timeout >1800s

The sharp transition between DELETE 1M and DELETE 10M suggests a blocked execution/termination path rather than general cluster slowness.

Good/bad comparison

The same DML SQL and the same 1800-second runner timeout were used in all runs.

MO commit DELETE 10M result
4d78bc66670418fbdeac2b18b07b2ef5b08b1d72 success, 17.2s
0102f7b85bcb8d960d7cc16a14b71682a58e7910 success, 14.9s
3ce64a29c63406574cbd86edd5484d08df946eeb timeout, >1800s

The bad commit is 54 commits after the most recent good baseline.

Downstream timeout amplification in the regression runner

run.py creates one cursor/connection for the entire SQL file. execute_sql.py wraps each statement with func_timeout; on timeout it only continues to the next statement and does not close/recreate the connection or explicitly cancel the server-side query.

After the DELETE 10M timeout, seven later statements timed out at exact 1800-second intervals. Because SQL text is logged before conn.ping(reconnect=True) and cursor.execute(sql), the later log entries do not prove those SQL statements reached MatrixOne. This runner behavior explains the 4-hour job duration, but it does not explain the initial DELETE hang.

Possible relation to Shuffle changes — not yet proven

PR #25814

#25814 unified Shuffle and ShuffleV2 and introduced the shared-pool lifecycle/backpressure implementation.

It is relevant to indefinite pipeline waits, but it is already contained in good commit 0102f7b8, where this DML case passed. Therefore it is not sufficient by itself to explain this DELETE regression. A timing-dependent latent issue is still possible.

PR #26017

#26017, merge commit 008786f5, is inside the good/bad range. It changed fixed-bucket backpressure from a global credit pool to per-bucket credits.

Its regression test directly exercises tryWrite/getFullBatch with two buckets. Existing operator-level coverage uses two uniformly distributed workers and normal completion. It does not cover a 16-holder heavily skewed workload, a final producer blocked on a hot bucket, early completion/reset, or client cancellation.

However, the explicit compile path for this large DELETE is:

compileDelete
  -> newDeleteMergeScope
  -> Dispatch
  -> distributed Deletion
  -> MergeDelete

That path does not by itself prove execution entered ShufflePool. The Shuffle hypothesis must be confirmed by a goroutine/profile stack showing shuffle.(*Shuffle).Call, flushPending, spaceWaiter, or waitBatchOrEnd, or by a minimal before/after test around 008786f5.

The TPCH Q16 hang tracked in #25922 has direct ShufflePool stack evidence. This DML failure currently does not, so the two should not be declared identical without more evidence.

Suggested investigation

  1. Inspect CN/TN logs and goroutine profiles for the first timeout window:
    • namespace: mo-big-data-commit-3ce64a2-suite-1y
    • UTC: 2026-07-22 20:04:18 to 20:34:18
    • CST: 2026-07-23 04:04:18 to 04:34:18
  2. Check for blocked stacks in:
    • shuffle.(*Shuffle).Call / flushPending / waitBatchOrEnd
    • dispatch
    • deletion / mergedelete
    • transaction commit or TN RPC
  3. Run only the failing DELETE around the narrow boundary:
  4. Use a statement/client timeout and recreate the SQL connection after timeout so later statements do not contaminate the result.

Expected behavior

The DELETE should complete in the same order of magnitude as the prior baselines and must respond to statement/client cancellation. It must not remain blocked indefinitely in execution, backpressure, dispatch, transaction commit, or cleanup.

Activity

  1. added
    kind/bug
    on Jul 23, 2026
  2. added theissue type on Jul 23, 2026
  3. added this to the MO-202607 milestone on Jul 23, 2026
  4. aptend commented on Jul 23, 2026

    @aptend
    Contributor

    Current working hypothesis: this may be related to the nested local Shuffle liveness problem addressed by #26055, but we do not have enough evidence to conclude that it is the same deadlock.

    What we know from run 29942753725:

    • The five CREATE TABLE ... CLONE ... statements completed normally in about 29–35 ms each.
    • The first persistent hang started at 2026-07-22 20:04:18 UTC on DELETE ...copy03 WHERE id <= 10000000. It timed out after 1800 seconds, and the following statements repeatedly timed out for the rest of the DML job.
    • Pyroscope has memory, malloc, block, and mutex data for the three CNs. Memory stayed stable, and there was no sustained mutex spike. We saw only a small transient Shuffle path (Shuffle.flushPending -> ShufflePool.tryWrite -> syncBatch), not the persistent wait-for cycle described by fix: prevent nested local shuffle deadlocks #26055.
    • This does not rule out that deadlock: Go block/mutex profiles primarily account for completed waits, so a goroutine permanently stuck on a channel/credit wait may not appear as a long block sample.
    • The decisive evidence would be goroutine stacks showing outer Shuffle writers waiting for bucket credits while the corresponding workers wait in an inner Shuffle/receiver tree. The raw ETL goroutine dumps were deleted with the Big Data bucket during cleanup, and this Big Data configuration did not scrape goroutine:goroutine into Pyroscope.

    To improve the next-run evidence, matrixorigin/mo-nightly-regression#1316 enables Pyroscope goroutine collection for the Big Data DN, LogService, CN, and Proxy pods. Once merged, we can inspect tomorrow's run for persistent Shuffle/PipelineSignalReceiver stacks and compare them across samples.

    So for now: #26055 is a plausible match, not a confirmed root cause.

  5. Ariznawlll commented on Jul 27, 2026

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

Metadata

Metadata

Assignees

Labels

kind/bugseverity/s-1

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions