From d527f3896911199ddc8239a51832bdb61943b915 Mon Sep 17 00:00:00 2001 From: pingcap-github-bot Date: Tue, 7 Apr 2020 18:27:24 +0800 Subject: [PATCH] skip wrongly write ActionUpdateTiFlashReplicaStatus job (#947) (#948) --- drainer/schema.go | 5 +++++ tests/filter/run.sh | 4 ++++ 2 files changed, 9 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..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);"