Skip to content

sync-diff-inspector: filter auto snapshot syncpoint by changefeed#899

Open
pingyu wants to merge 2 commits into
pingcap:masterfrom
pingyu:sync-diff-checkpoint-changefeed
Open

sync-diff-inspector: filter auto snapshot syncpoint by changefeed#899
pingyu wants to merge 2 commits into
pingcap:masterfrom
pingyu:sync-diff-checkpoint-changefeed

Conversation

@pingyu

@pingyu pingyu commented Jun 14, 2026

Copy link
Copy Markdown

What problem does this PR solve?

Issue Number: close #898

sync-diff-inspector currently resolves snapshot = "auto" by reading the latest row from tidb_cdc.syncpoint_v1 globally. When multiple TiCDC changefeeds write syncpoint rows into the same downstream table, this can select another changefeed's syncpoint and produce false-positive data mismatches.

What is changed and how it works?

This PR adds an optional syncpoint-changefeed task config for sync-diff-inspector. When both source and target snapshots are set to "auto" and this option is configured, sync-diff-inspector filters tidb_cdc.syncpoint_v1 by that changefeed before selecting the latest syncpoint row. If the option is omitted, the existing global latest-row behavior is preserved.

The change also updates the config template, includes the new field in the task config hash, and adds unit coverage for config parsing plus filtered syncpoint lookup behavior.

Check List

Tests

  • Unit test (go test ./sync_diff_inspector/config ./sync_diff_inspector/source)

Code changes

  • Has exported variable/fields change

Release Note

sync-diff-inspector supports filtering auto snapshot syncpoint lookup by TiCDC changefeed with the `syncpoint-changefeed` configuration.

pingyu added 2 commits June 14, 2026 15:37
Signed-off-by: Ping Yu <yuping@pingcap.com>
Signed-off-by: Ping Yu <yuping@pingcap.com>
@ti-chi-bot

ti-chi-bot Bot commented Jun 14, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign reminiscent for approval. For more information see the Code Review Process.
Please ensure that each of them provides their approval before proceeding.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@pingcap-cla-assistant

pingcap-cla-assistant Bot commented Jun 14, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sync-diff-inspector auto snapshot can pick the wrong changefeed syncpoint

1 participant