pt-online-schema-change can break replication
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Percona Toolkit moved to https://jira.percona.com/projects/PT |
Fix Released
|
High
|
Daniel Nichter |
Bug Description
pt-online-
MySQL version:
on slave:
show slave status\G
Replicate
Replicate_
Master_
binlog on master:
mysqlbinlog -v -v --base64-
#120216 0:00:27 server id 152233306 end_log_pos 29260 Table_map: `db`.`tiny_url` mapp
ed to number 278651
#120216 0:00:27 server id 152233306 end_log_pos 29324 Table_map: `db`.`_
` mapped to number 278645
#120216 0:00:27 server id 152233306 end_log_pos 29420 Write_rows: table id 278651
#120216 0:00:27 server id 152233306 end_log_pos 29516 Write_rows: table id 278645 flags: S
TMT_END_F
### INSERT INTO db.tiny_url
### SET
### @1=88801080 /* INT meta=0 nullable=0 is_null=0 */
### @2='http://
ull=0 */
### @3='--' /* VARSTRING(18) meta=18 nullable=0 is_null=0 */
### @4=0 /* LONGINT meta=0 nullable=0 is_null=0 */
### @5='00:00:27' /* TIME meta=0 nullable=0 is_null=0 */
### INSERT INTO db.__tmp_tiny_url
### SET
### @1=88801080 /* INT meta=0 nullable=0 is_null=0 */
### @2='http://
ull=0 */
### @3='--' /* VARSTRING(18) meta=18 nullable=0 is_null=0 */
### @4=0 /* LONGINT meta=0 nullable=0 is_null=0 */
### @5='00:00:27' /* TIME meta=0 nullable=0 is_null=0 */
# at 29516
#120216 0:00:27 server id 152233306 end_log_pos 29543 Xid = 38657832443
COMMIT/*!*/;
# at 29543
__tmp_tiny_url created only on master but triggers wrote binlog so error occured on slave.
Related branches
- Daniel Nichter: Approve
-
Diff: 349 lines (+111/-34) (has conflicts)4 files modifiedbin/pt-online-schema-change (+39/-9)
t/pt-online-schema-change/alter_active_table.t (+1/-1)
t/pt-online-schema-change/basics.t (+63/-23)
t/pt-online-schema-change/option_sanity.t (+8/-1)
tags: | added: pt-online-schema-change risk triggers |
summary: |
- pt-online-schema-change break replication because of binlog of triggers + pt-online-schema-change and triggers break replication |
Changed in percona-toolkit: | |
status: | Triaged → In Progress |
Changed in percona-toolkit: | |
status: | In Progress → Fix Committed |
Changed in percona-toolkit: | |
milestone: | none → 2.0.4 |
summary: |
- pt-online-schema-change breaks replication + pt-online-schema-change can break replication (add --execute) |
summary: |
- pt-online-schema-change can break replication (add --execute) + pt-online-schema-change can break replication |
Changed in percona-toolkit: | |
status: | Fix Committed → Fix Released |
I misread the initial report. There aren't triggers, but pt-online-schema changes create a temp table on a master with SQL_LOG_BIN=0, then when binary logging is re-enabled, it does DROP TABLE <temp table>, which breaks replication. t/pt-online- schema- change/ basics. t causes this problem, too.