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

cdc cli changefeed create --start-ts does not work properly and may lead to data loss #2303

Closed
overvenus opened this issue Jul 16, 2021 · 5 comments · Fixed by #2744
Closed
Assignees
Labels
area/ticdc Issues or PRs related to TiCDC. component/cli CLI component. component/replica-model Replication model component. difficulty/easy Easy task. severity/major type/bug The issue is confirmed as a bug.

Comments

@overvenus
Copy link
Member

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.

TiCDC cli creates a changefeed that does not use the start-ts specified in command line. It leads to data loss.

image

Note that the start-ts in command line is invalid and it points to 1975-02-25 15:14:19.597000.

mysql> select tidb_parse_tso(426318359552065537); # start-ts in cli output

+------------------------------------+
| tidb_parse_tso(426318359552065537) |
+------------------------------------+
| 2021-07-14 23:11:20.469000         |
+------------------------------------+

mysql> select tidb_parse_tso(42610054816776198); # start-ts in command line

+-----------------------------------+
| tidb_parse_tso(42610054816776198) |
+-----------------------------------+
| 1975-02-25 15:14:19.597000        |
+-----------------------------------+
  1. What did you expect to see?

a. create a changefeed with a start-ts specified in command line.
b. report warnings about invalid start-ts.

  1. What did you see instead?

A wrong changefeed is created and it leads to data loss.

  1. Versions of the cluster

v5.0.1

@overvenus overvenus added type/bug The issue is confirmed as a bug. component/replica-model Replication model component. component/cli CLI component. labels Jul 16, 2021
@amyangfei
Copy link
Contributor

amyangfei commented Jul 16, 2021

Strange, the start-ts should be checked against GC safepoint, what does invalid mean?

@overvenus
Copy link
Member Author

Strange, the start-ts should be checked against GC safepoint, what does invalid means?

Sorry, I mean the ts is way behind TiDB gc safepoint.

@overvenus
Copy link
Member Author

image

@liuzix finds that there is an unexpected character ‘c2 a0’ before "--start-ts”. It may cause this issue.

@asddongmen
Copy link
Contributor

It seems that any char before a flag will cause this error.!
2021721-18274

@Rustin170506
Copy link
Member

We can use cobra.NoArgs to report this error explicitly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ticdc Issues or PRs related to TiCDC. component/cli CLI component. component/replica-model Replication model component. difficulty/easy Easy task. severity/major type/bug The issue is confirmed as a bug.
Projects
None yet
5 participants