Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DDL handling fails when changefeed starts at FinishTs of a schema change #2603

Closed
liuzix opened this issue Aug 23, 2021 · 0 comments · Fixed by #2604
Closed

DDL handling fails when changefeed starts at FinishTs of a schema change #2603

liuzix opened this issue Aug 23, 2021 · 0 comments · Fixed by #2604
Assignees
Labels
affects-4.0 affects-5.0 affects-5.1 area/ticdc Issues or PRs related to TiCDC. bug-from-internal-test Bugs found by internal testing. component/replica-model Replication model component. release-blocker This issue blocks a release. Please solve it ASAP. severity/critical type/bug The issue is confirmed as a bug.

Comments

@liuzix
Copy link
Contributor

liuzix commented Aug 23, 2021

Bug Report

Please answer these questions before submitting your issue. Thanks!

  1. What did you do? If possible, provide a recipe for reproducing the error.
  • Truncate some tables, and while the DDLs are still being executed, kill the owner.
  1. What did you expect to see?
  • The cluster can recover and replication continues
  1. What did you see instead?
  • CDC:ErrSchemaStorageTableMiss.
  1. Versions of the cluster

    • TiCDC version (execute cdc version):

      v5.2.0
      
  2. Cause

The TS used for snapshot read from TiKV is not correctly set. https://github.com/pingcap/ticdc/blob/04fa75b2ae194e481e8a82c0cd12bf7d8ca2a249/cdc/owner/schema.go#L44

        var meta *timeta.Meta
	if kvStorage != nil {
		var err error
		meta, err = kv.GetSnapshotMeta(kvStorage, startTs)  // wrong! should be startTs-1
		if err != nil {
			return nil, errors.Trace(err)
		}
	}
	// We do a snapshot read of the metadata from TiKV at (startTs-1) instead of startTs,
	// because the DDL puller might send a DDL at startTs, which would cause schema conflicts if
	// the DDL's result is already contained in the snapshot.
	schemaSnap, err := entry.NewSingleSchemaSnapshotFromMeta(meta, startTs-1, config.ForceReplicate)
	if err != nil {
		return nil, errors.Trace(err)
	}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-4.0 affects-5.0 affects-5.1 area/ticdc Issues or PRs related to TiCDC. bug-from-internal-test Bugs found by internal testing. component/replica-model Replication model component. release-blocker This issue blocks a release. Please solve it ASAP. severity/critical type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants