Skip to content

[CDC] stale running tasks, watermark update timeouts, and drop cdc fails with invalid connection #25297

Closed

Description

@lxw665

Summary

In a private MatrixOne deployment, multiple CDC tasks appear running in mo_cdc task show, but their checkpoints are stale or failed. The CDC watermark updater continuously fails with context deadline exceeded, and drop cdc task / drop cdc all fail with invalid connection, leaving old paused tasks in CDC metadata and watermark updates.

This looks like a CDC control-plane / metadata / watermark consistency problem rather than a simple client network issue:

  • Normal MySQL queries against the same cluster return successfully in sub-second time.
  • mo_cdc task show still prints repeated [mysql] ... unexpected EOF.
  • CN logs continue to report cdc.watermark.read_error.
  • Old paused tasks still appear in watermark update SQL.
  • Dropping those tasks fails with invalid connection.

Environment

  • MatrixOne version: 8.0.30-MatrixOne-v3.0.0-5e4210029-hotfix-20260603
  • Deployment: private deployment, same MatrixOne cluster, cross-account CDC.
  • Client: mo_cdc binary from local mo-backup; this binary does not expose --version or version.
  • CDC uses table-level PITR. Existing PITR:
    • ods_s4.t_s4_performance: 24h
    • ods_s4.performance_file_attach: 24h
    • ods_ecc.performance_file_attach: 24h

Tasks Involved

1. FIN -> BID, ods_s4.t_s4_performance

Original task:

  • Task name: private_fin_ods_s4_to_bid_t_s4_performance_cdc
  • Task ID: 019ed526-3bca-7555-b23c-f95801fa85e3
  • Current state: paused
  • Current checkpoint shown by mo_cdc task show:
ods_s4.t_s4_performance: 2026-06-29 17:42:16.080563741 +0000 UTC

Rebuild full task:

  • Task name: private_fin_ods_s4_to_bid_t_s4_performance_cdc_full_20260701
  • Task ID: 019f1bb8-537d-79a6-ad6b-0880137f36f5
  • Current state: paused
  • Checkpoint stayed at:
ods_s4.t_s4_performance: 1970-01-01 00:00:00 +0000 UTC

Current incremental no-full task:

  • Task name: private_fin_ods_s4_to_bid_t_s4_performance_cdc_incr_20260701
  • Task ID: 019f1bbd-5add-705b-b7f7-044e90e50023
  • Current state: running
  • Checkpoint shown by mo_cdc task show:
ods_s4.t_s4_performance: 2026-07-01 03:33:48.007446058 +0000 UTC

Current data count is correct:

source fin.ods_s4.t_s4_performance rows: 162442
target bid.ods_s4.t_s4_performance rows: 162442
target distinct (VBELN, POSNR): 162442
target duplicate groups by (VBELN, POSNR): 0

However, the watermark updater still reports errors for both the old paused task and the new incremental task.

2. BID -> FIN, S4 attachment table

  • Task name: private_bid_to_fin_s4_attach_cdc
  • Task ID: 019f115c-23d9-78fa-a2cd-429a2c1b35bc
  • Source: ods_s4.performance_file_attach
  • Target: jst_receipts_tables.performance_file_attach__s4_cdc
  • Current state: running
  • Current checkpoint shown by mo_cdc task show:
ods_s4.performance_file_attach:
2026-06-29 17:40:32.973762825 +0000 UTC
(Failed, error: N:1782766991:internal error: internal error: no watermark found)

Current data count is not aligned:

source bid.ods_s4.performance_file_attach rows: 54581
target fin.jst_receipts_tables.performance_file_attach__s4_cdc rows: 54526
diff: 55 rows missing on target

3. BID -> FIN, ECC attachment table

  • Task name: private_bid_to_fin_ecc_attach_cdc
  • Task ID: 019f115c-2b93-7d68-81a4-fe6c77f9425a
  • Source: ods_ecc.performance_file_attach
  • Target: jst_receipts_tables.performance_file_attach_ecc_cdc
  • Current state: running
  • Current checkpoint shown by mo_cdc task show:
ods_ecc.performance_file_attach: 2026-06-29 17:40:33.561126733 +0000 UTC

Current data count is aligned:

source bid.ods_ecc.performance_file_attach rows: 22451
target fin.jst_receipts_tables.performance_file_attach_ecc_cdc rows: 22451

But the checkpoint is stale and CN logs show repeated watermark update failures for this task.

Operation Log

2026-07-01: checked current CDC state

Command pattern:

mo_cdc task show --source-uri "<redacted-fin-source-uri>" --all
mo_cdc task show --source-uri "<redacted-bid-source-uri>" --all

Both commands returned JSON, but also printed repeated client errors:

[mysql] 2026/07/01 13:31:43 connection.go:49: unexpected EOF
[mysql] 2026/07/01 13:31:44 connection.go:49: unexpected EOF

2026-07-01: verified normal MySQL queries work

The following checks succeeded quickly against the same cluster:

SELECT NOW(), CONNECTION_ID(), COUNT(*) FROM ods_s4.t_s4_performance;
SELECT NOW(), CONNECTION_ID(), COUNT(*) FROM ods_s4.performance_file_attach;

Results:

FIN t_s4 rows: 162442
BID S4 attachment rows: 54581

So the issue is not simply that the client cannot connect to MatrixOne.

2026-07-01: tried to clean old CDC tasks

The following operations failed:

mo_cdc task drop --source-uri "<redacted-fin-source-uri>" \
  --task-name "private_fin_ods_s4_to_bid_t_s4_performance_cdc"

mo_cdc task drop --source-uri "<redacted-fin-source-uri>" \
  --task-name "private_fin_ods_s4_to_bid_t_s4_performance_cdc_full_20260701"

drop cdc all

CN logs:

2026/07/01 03:27:22 UTC
caller=frontend/cdc_handle.go:339
msg=cdc.on_pre_update.delete_task.failed
task-name=private_fin_ods_s4_to_bid_t_s4_performance_cdc
error=invalid connection

2026/07/01 03:27:22 UTC
caller=frontend/cdc_handle.go:267
msg=cdc.do_update_task.failed
task-name=private_fin_ods_s4_to_bid_t_s4_performance_cdc
target-status=CancelRequested
affected-count=0
error=invalid connection

2026/07/01 03:27:22 UTC
statement="drop cdc task private_fin_ods_s4_to_bid_t_s4_performance_cdc"
status=fail
error=invalid connection

For the full rebuild task:

2026/07/01 03:33:39 UTC
caller=frontend/cdc_handle.go:355
msg=cdc.on_pre_update.delete_watermark.failed
task-name=private_fin_ods_s4_to_bid_t_s4_performance_cdc_full_20260701
key-count=1
error=invalid connection

2026/07/01 03:33:39 UTC
caller=frontend/cdc_handle.go:267
msg=cdc.do_update_task.failed
task-name=private_fin_ods_s4_to_bid_t_s4_performance_cdc_full_20260701
target-status=CancelRequested
affected-count=0
error=invalid connection

For drop cdc all:

2026/07/01 03:27:45 UTC
statement="drop cdc all"
status=fail
error=invalid connection

2026-07-01: watermark updater still failing after recheck

Recent CN logs from 2026-07-01 05:28-05:32 UTC:

caller=cdc/watermark_updater.go:427
msg=cdc.watermark.read_error
error="context deadline exceeded\ninternal error: watermark update"
err-msg="commit sql \"INSERT INTO `mo_catalog`.`mo_cdc_watermark`
  (account_id, task_id, db_name, table_name, watermark)
VALUES
  (10001, '019f1bbd-5add-705b-b7f7-044e90e50023', 'ods_s4', 't_s4_performance', ...),
  (20002, '019f115c-2b93-7d68-81a4-fe6c77f9425a', 'ods_ecc', 'performance_file_attach', ...),
  (10001, '019ed526-3bca-7555-b23c-f95801fa85e3', 'ods_s4', 't_s4_performance', ...)
ON DUPLICATE KEY UPDATE watermark = VALUES(watermark)\" failed"

The old paused task 019ed526-3bca-7555-b23c-f95801fa85e3 is still included in watermark update SQL together with the new incremental task 019f1bbd-5add-705b-b7f7-044e90e50023.

Other repeated logs:

caller=cdc/watermark_updater.go:427
msg=cdc.watermark.read_error
error="context deadline exceeded\ninternal error: watermark update err msg"
err-msg="update err_msg sql \"INSERT INTO `mo_catalog`.`mo_cdc_watermark`
  (account_id, task_id, db_name, table_name, err_msg)
VALUES
  (10001, '019ed526-3bca-7555-b23c-f95801fa85e3', 'ods_s4', 't_s4_performance', ''),
  (10001, '019f1bbd-5add-705b-b7f7-044e90e50023', 'ods_s4', 't_s4_performance', '')
ON DUPLICATE KEY UPDATE err_msg = VALUES(err_msg)\" failed"

And for the ECC attachment task:

caller=cdc/watermark_updater.go:427
msg=cdc.watermark.read_error
error="context deadline exceeded\ninternal error: watermark update err msg"
err-msg="update err_msg sql \"INSERT INTO `mo_catalog`.`mo_cdc_watermark`
  (account_id, task_id, db_name, table_name, err_msg)
VALUES
  (20002, '019f115c-2b93-7d68-81a4-fe6c77f9425a', 'ods_ecc', 'performance_file_attach', '')
ON DUPLICATE KEY UPDATE err_msg = VALUES(err_msg)\" failed"

Expected Behavior

  1. drop cdc task should reliably remove task metadata and watermark metadata, or return an actionable error without leaving the task in a half-deleted state.
  2. Paused or cancelled tasks should not continue to participate in active watermark updater batches.
  3. A failure in one task's watermark update should not block watermark progress for unrelated running tasks.
  4. mo_cdc task show should not report running without surfacing stale checkpoint / failed watermark health clearly.
  5. A running task should not remain indefinitely at a failed checkpoint such as no watermark found.

Actual Behavior

  1. drop cdc task and drop cdc all fail with invalid connection.
  2. Old paused tasks still appear in watermark update SQL.
  3. Watermark updater repeatedly fails with context deadline exceeded.
  4. mo_cdc task show reports tasks as running, while checkpoints are stale or failed.
  5. One S4 attachment CDC task is already data-inconsistent: target is missing 55 rows.

Questions / Help Needed

  1. What is the supported way to safely clean up CDC metadata / watermark rows / runner state when drop cdc task fails with invalid connection?
  2. Why can paused tasks remain in watermark update SQL?
  3. Should the watermark updater batch multiple tasks together in one SQL statement? If yes, how is task-level isolation guaranteed when one task/connection times out?
  4. Why does mo_cdc task show keep returning running when checkpoint is stale or has no watermark found?
  5. Is the repeated unexpected EOF from mo_cdc task show expected/retryable, or does it indicate a CDC client/server protocol problem?

Impact

This blocks reliable private-deployment CDC usage. We can manually repair table data by full rebuild, but the CDC control plane remains unhealthy:

  • stale paused tasks cannot be deleted;
  • watermark updates keep timing out;
  • at least one running CDC task has already diverged by 55 rows;
  • users cannot tell from state=running whether CDC is actually healthy.

Activity

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

    @jiangxinmeng1
    Contributor

    lock service上死锁了

    2026-07-01 13:54:09 UTC
    cycle: fb8c6734e8469b8718bc9f05ff61b2a3 <= 95391188fea8e7b018bc9f1a5c2b7d16 <= fb8c6734e8469b8718bc9f05ff61b2a3
    
    2026-07-01 13:54:08 UTC
    cycle: caee389b8663578318bc9f309d0b597f <= caee389b8663578318bc9f309d0c3791 <= caee389b8663578318bc9f309d0b597f
    
    2026-07-02 05:29:37 UTC
    cycle: fb8c6734e8469b8718bc9f0600100502 <= caee389b8663578318bc9f309d42e387 <= fb8c6734e8469b8718bc9f0600100502
    
  5. added a commit that references this issue on Jul 4, 2026
    826d7ee
  6. added
    ai-heavy
    on Jul 6, 2026
  7. added 2 commits that reference this issue on Jul 6, 2026
    9c9a178
    c51acef
  8. added a commit that references this issue on Jul 17, 2026
    e15148a
  9. added 3 commits that reference this issue on Sep 17, 2026
    c76ee82
    66815e8
    f9ded7f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

ai-heavykind/bugseverity/s-1

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions