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

Unnecessary rollback and Fail to drop table from schema tracker when pause task #3734

Closed
GMHDBJD opened this issue Aug 25, 2021 · 2 comments · Fixed by #5350
Closed

Unnecessary rollback and Fail to drop table from schema tracker when pause task #3734

GMHDBJD opened this issue Aug 25, 2021 · 2 comments · Fixed by #5350
Assignees
Labels
area/dm Issues or PRs related to DM. severity/minor type/bug The issue is confirmed as a bug.

Comments

@GMHDBJD
Copy link
Contributor

GMHDBJD commented Aug 25, 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.
insert into tb1 values (1)
insert into tb2 values (2)
stop-task
start-task
insert into tb1 values(3)
pause-task
  1. What did you expect to see?
    no need to rollback, no error log
  2. What did you see instead?
    table 2 failed to rollback
[2021/08/24 23:01:30.377 -04:00] [DEBUG] [checkpoint.go:691] ["try to rollback checkpoint"] [task=test] [unit="binlog replication"] [component="remote checkpoint"] [schema=shardddl1] [table=tb1] [checkpoint="position: (mysql-bin.000001, 1990), gtid-set: (flushed position: (mysql-bin.000001, 1990), gtid-set: )"]
[2021/08/24 23:01:30.378 -04:00] [DEBUG] [checkpoint.go:691] ["try to rollback checkpoint"] [task=test] [unit="binlog replication"] [component="remote checkpoint"] [schema=shardddl1] [table=tb2] [checkpoint="position: (mysql-bin.000001, 1735), gtid-set: (flushed position: (mysql-bin.000001, 1735), gtid-set: )"]
[2021/08/24 23:01:30.378 -04:00] [INFO] [checkpoint.go:694] ["rollback checkpoint"] [task=test] [unit="binlog replication"] [component="remote checkpoint"] [schema=shardddl1] [table=tb2] [from="position: (mysql-bin.000001, 1735), gtid-set: "] [to="position: (mysql-bin.000001, 1735), gtid-set: "]
[2021/08/24 23:01:30.378 -04:00] [WARN] [checkpoint.go:697] ["failed to drop table from schema tracker"] [task=test] [unit="binlog replication"] [component="remote checkpoint"] [schema=shardddl1] [table=tb2] [error="[schema:1146]Table 'shardddl1.tb2' doesn't exist"]
  1. Root Cause.
    We use lazy init checkpoint schema now, so the case is that the table info exists in table checkpoint but not exists in schema tracker. In this situation, we don't need to rollback it. Meanwhile, we now no need to create the table in schema tracker during rollback, just simply delete the table and create after task resume.
@lance6716
Copy link
Contributor

lance6716 commented Sep 28, 2021

in https://asktug.com/t/topic/182909 , DM v2.0.1 drops 2600 tables costing 1h25m 😂 (hope in later version, each DDL will not wait 2 seconds to finish)

@lance6716
Copy link
Contributor

And if the rolling back costs a lots of time, the progress will be displayed "Running" because Syncer.Process is not exited, which is misleading to user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/dm Issues or PRs related to DM. severity/minor type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants