Skip to content

[Bug]: ISCP task runner is published before executor readiness, causing clone failure in Multi-CN + Proxy #26181

Closed

Description

@XuPeng-SH

Is there an existing issue for the same bug?

  • I have checked the existing issues.

Branch Name

xp/ci-race-coverage-artifacts

Commit ID

bb6cf549be44c5162255f74c87dc03fb9b6fa6a7

Other Environment Information

  • Hardware parameters: GitHub Actions Linux CI runner (Compose BVT job)
  • OS type: Linux
  • Deployment: Docker Compose, 2 CN + TN + LogService + real Proxy; SQL traffic enters Proxy on port 6001 and is routed to either CN.
  • Failing workflow/job: Coverage Integration run 30182890014

Actual Behavior

A clone operation involving an asynchronous index can fail immediately after a Multi-CN cluster becomes SQL-ready.

The failing statement is:

create database test03_new clone test03 {snapshot = 'sp03'};

It fails with:

internal error: cannot confirm ISCP consumer quiescence on CN dd1dccb4-4d3c-41f8-b482-5251dc7a41bf for tableID=272617 jobName=index_idx01 jobID=1

The remaining failures in test/distributed/cases/pessimistic_transaction/clone/clone.sql are cascading failures because test03_new was never created.

The failure is not caused by coverage collection, image-cache loading, or the BVT partitioning:

  • the shared Compose image was loaded successfully;
  • Docker Compose started successfully;
  • the BVT ran for about 15 minutes before reporting 9 failures, all from this clone case;
  • coverage data was still generated after teardown.

Expected Behavior

Once a CN is exposed as the ISCP task runner, ISCP operations routed to that CN must be serviceable. A valid clone statement must not fail merely because the assigned CN has not yet completed ISCP executor startup.

The operation may wait for a bounded startup interval, but must remain fail-closed: clone must not proceed until consumer quiescence has been confirmed.

Steps to Reproduce

  1. Start MatrixOne with Docker Compose using two CN services and Proxy enabled; connect client traffic through Proxy.
  2. Wait only until SQL is reachable through Proxy (for example, a simple create table succeeds).
  3. Run test/distributed/cases/pessimistic_transaction/clone/clone.sql, or create a database containing an asynchronous index and execute a clone from a snapshot immediately after startup.
  4. Observe that the clone may route to a CN whose task_runner assignment is visible but whose local ISCP executor runtime has not been registered.

Additional information

Evidence and root-cause analysis

The lifecycle currently has a readiness gap:

taskservice.startDaemonTask:
  persist task_runner=<CN> and status=RUNNING
    -> invoke ISCPTaskExecutorFactory
      -> repair/rebuild ISCP state
        -> RegisterExecutorRuntime(<CN>)

GetTaskRunner reads mo_task.sys_daemon_task.task_runner and drainIndexCdcTaskConsumer sends ISCPDrainConsumer to that CN. handleISCPDrainConsumer then immediately fails if iscp.GetExecutorRuntime(s.cfg.UUID) is absent.

In the failing logs:

  • the clone request was routed to CN dd1dccb4-4d3c-41f8-b482-5251dc7a41bf;
  • that CN logged the missing-runtime error at 01:42:57;
  • another CN initialized and started an ISCP executor only about 1.7 seconds later;
  • the request therefore observed task-runner assignment before a usable executor, and the task-runner target may change while startup/recovery is in progress.

Proposed fix

Do not use daemon-task assignment as the readiness signal.

  1. In pkg/cnservice/server_query.go, let handleISCPDrainConsumer wait for a short, context-bounded interval for a local, running executor rather than immediately returning an internal error.
  2. Return a distinct, retryable ISCP executor not ready result/error when that interval expires.
  3. In pkg/sql/compile/iscp_util.go, on only that retryable condition, use bounded backoff and re-read task_runner plus its query address before retrying. Do not retry arbitrary drain errors.
  4. Preserve fail-closed behavior: only proceed after CancelAndDrainJobConsumer succeeds.

Avoid changing generic taskservice.startDaemonTask semantics globally: it is shared by every daemon task and its RUNNING/task_runner state is also part of lease/failover handling.

Acceptance criteria

  • A delayed ISCP executor registration after task assignment no longer makes clone fail.
  • If task-runner ownership changes during startup, the caller refreshes the target and succeeds once a running executor is available.
  • A permanently unavailable executor fails after a bounded timeout with an actionable readiness error.
  • Non-readiness drain errors are returned without retry.
  • Add handler and compile-layer unit tests plus a 2-CN + Proxy regression test that forces the assignment-before-registration window.

Activity

  1. added
    kind/bug
    on Jul 26, 2026
  2. added
    severity/s0
    and removed on Jul 26, 2026
  3. added a commit that references this issue on Jul 26, 2026
    c8d29e9
  4. added 3 commits that reference this issue on Sep 17, 2026
    1dd62d7
    3261556
    4ce846d
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

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions