diff --git a/drainer/schema.go b/drainer/schema.go index c74b6fedd..eacb31f13 100644 --- a/drainer/schema.go +++ b/drainer/schema.go @@ -251,6 +251,11 @@ func (s *Schema) handlePreviousDDLJobIfNeed(version int64) error { log.Info("Got DeleteOnly Job", zap.Stringer("job", job)) continue } + + if skipFlash(job) { + continue + } + _, _, _, err := s.handleDDL(job) if err != nil { return errors.Annotatef(err, "handle ddl job %v failed, the schema info: %s", s.jobs[i], s) diff --git a/tests/filter/run.sh b/tests/filter/run.sh index ae0219de7..baee1a6b5 100755 --- a/tests/filter/run.sh +++ b/tests/filter/run.sh @@ -25,12 +25,16 @@ run_sql "CREATE DATABASE do_name;" run_sql "CREATE DATABASE do_not_start1;" run_sql "CREATE DATABASE do_not_name;" + run_sql "CREATE TABLE test.do_start1(id int);" run_sql "CREATE TABLE test.do_name(id int);" run_sql "CREATE TABLE test.do_not_start1(id int);" run_sql "CREATE TABLE test.do_not_name(id int);" run_sql "CREATE TABLE test.do_ignore_name(id int);" +# Test this DDL about tiflash will not abort the replication. +run_sql "ALTER TABLE test.do_start1 SET TIFLASH REPLICA 3 LOCATION LABELS \"rack\", \"host\", \"abc\""; + run_sql "INSERT INTO test.do_start1(id) VALUES (1);" run_sql "INSERT INTO test.do_name(id) VALUES (1);" run_sql "INSERT INTO test.do_not_start1(id) VALUES (1);"