From 12290037da11659a3577b30ca76f09c7dd6dfab2 Mon Sep 17 00:00:00 2001 From: Jiahao Huang Date: Tue, 7 Apr 2020 16:45:58 +0800 Subject: [PATCH 1/2] Fix tiflash --- drainer/schema.go | 5 +++++ tests/filter/run.sh | 3 +++ 2 files changed, 8 insertions(+) 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..5ee3135a8 100755 --- a/tests/filter/run.sh +++ b/tests/filter/run.sh @@ -25,6 +25,9 @@ run_sql "CREATE DATABASE do_name;" run_sql "CREATE DATABASE do_not_start1;" run_sql "CREATE DATABASE do_not_name;" +# Test this DDL about tiflash will not abort the replication. +run_sql "ALTER TABLE do_start1 SET TIFLASH REPLICA 3 LOCATION LABELS \"rack\", \"host\", \"abc\""; + 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);" From b45829c458b1b6c4fd87321613c31aab83df3c63 Mon Sep 17 00:00:00 2001 From: Jiahao Huang Date: Tue, 7 Apr 2020 17:12:58 +0800 Subject: [PATCH 2/2] Fix integration test --- tests/filter/run.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/filter/run.sh b/tests/filter/run.sh index 5ee3135a8..baee1a6b5 100755 --- a/tests/filter/run.sh +++ b/tests/filter/run.sh @@ -25,8 +25,6 @@ run_sql "CREATE DATABASE do_name;" run_sql "CREATE DATABASE do_not_start1;" run_sql "CREATE DATABASE do_not_name;" -# Test this DDL about tiflash will not abort the replication. -run_sql "ALTER TABLE do_start1 SET TIFLASH REPLICA 3 LOCATION LABELS \"rack\", \"host\", \"abc\""; run_sql "CREATE TABLE test.do_start1(id int);" run_sql "CREATE TABLE test.do_name(id int);" @@ -34,6 +32,9 @@ 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);"