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

skip wrongly write ActionUpdateTiFlashReplicaStatus job (#947) #948

Merged
merged 2 commits into from
Apr 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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