Repository navigation
Description
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
- Start MatrixOne with Docker Compose using two CN services and Proxy enabled; connect client traffic through Proxy.
- Wait only until SQL is reachable through Proxy (for example, a simple
create tablesucceeds). - 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. - Observe that the clone may route to a CN whose
task_runnerassignment 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.
- In
pkg/cnservice/server_query.go, lethandleISCPDrainConsumerwait for a short, context-bounded interval for a local, running executor rather than immediately returning an internal error. - Return a distinct, retryable
ISCP executor not readyresult/error when that interval expires. - In
pkg/sql/compile/iscp_util.go, on only that retryable condition, use bounded backoff and re-readtask_runnerplus its query address before retrying. Do not retry arbitrary drain errors. - Preserve fail-closed behavior: only proceed after
CancelAndDrainJobConsumersucceeds.
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
fix(iscp): retry drain while executor initializes (#26183)
fix(iscp): retry drain while executor initializes (matrixorigin#26183)
fix(iscp): retry drain while executor initializes (matrixorigin#26183)
fix(iscp): retry drain while executor initializes (matrixorigin#26183)