Skip to content

Commit

Permalink
skip wrongly write ActionUpdateTiFlashReplicaStatus job (#947) (#948)
Browse files Browse the repository at this point in the history
  • Loading branch information
sre-bot committed Apr 7, 2020
1 parent 553b0ac commit d527f38
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drainer/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 4 additions & 0 deletions tests/filter/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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);"
Expand Down

0 comments on commit d527f38

Please sign in to comment.