Uploaded image for project: 'Percona Toolkit'
  1. Percona Toolkit
  2. PT-297

``pt-online-schema-change`` could break replication.

Details

    Description

      **Reported in Launchpad by gu lei last update 19-03-2012 16:57:32

      pt-online-schema-change h=127.0.0.1,P=3306,t=db.tiny_url --alter "drop key url","add key url(url(80))" --sleep 0.1

      MySQL version:5.1.55-rel12.6-log Percona Server with XtraDB (GPL), Release 12.6, Revision 200

      on slave:

      show slave status\G

      Master_Host: 192.168.1.1
      Master_User: repuser
      Master_Port: 3306
      Connect_Retry: 60
      Master_Log_File: crtalk1-bin.009260
      Read_Master_Log_Pos: 125939386
      Relay_Log_File: tw_usr-relay-bin.029288
      Relay_Log_Pos: 122264451
      Relay_Master_Log_File: crtalk1-bin.009260
      Slave_IO_Running: Yes
      Slave_SQL_Running: No
      Replicate_Do_DB:
      Replicate_Ignore_DB:
      Replicate_Do_Table:
      Replicate_Ignore_Table:
      Replicate_Wild_Do_Table:
      Replicate_Wild_Ignore_Table:
      Last_Errno: 1146
      Last_Error: Error 'Table 'db.__tmp_tiny_url' doesn't exist' on opening tables
      Skip_Counter: 0
      Exec_Master_Log_Pos: 122264304
      Relay_Log_Space: 125939734
      Until_Condition: None
      Until_Log_File:
      Until_Log_Pos: 0
      Master_SSL_Allowed: No
      Master_SSL_CA_File:
      Master_SSL_CA_Path:
      Master_SSL_Cert:
      Master_SSL_Cipher:
      Master_SSL_Key:
      Seconds_Behind_Master: NULL
      Master_SSL_Verify_Server_Cert: No
      Last_IO_Errno: 0
      Last_IO_Error:
      Last_SQL_Errno: 1146
      Last_SQL_Error: Error 'Table 'db.__tmp_tiny_url' doesn't exist' on opening tables

      binlog on master:
      mysqlbinlog -v -v --base64-output=DECODE-ROWS crtalk1-bin.009261 | grep -B 1 -A 10 __tmp|more
      #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`.`__tmp_tiny_url
      ` 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

          1. INSERT INTO db.tiny_url
          2. SET
          3. @1=88801080 /* INT meta=0 nullable=0 is_null=0 */
          4. @2='http://15449413.blog.hexun.com/62026240_d.html' /* VARSTRING(400) meta=400 nullable=0 is_n
            ull=0 */
          5. @3='--' /* VARSTRING(18) meta=18 nullable=0 is_null=0 */
          6. @4=0 /* LONGINT meta=0 nullable=0 is_null=0 */
          7. @5='00:00:27' /* TIME meta=0 nullable=0 is_null=0 */
          8. INSERT INTO db.__tmp_tiny_url
          9. SET
          10. @1=88801080 /* INT meta=0 nullable=0 is_null=0 */
          11. @2='http://15449413.blog.hexun.com/62026240_d.html' /* VARSTRING(400) meta=400 nullable=0 is_n
            ull=0 */
          12. @3='--' /* VARSTRING(18) meta=18 nullable=0 is_null=0 */
          13. @4=0 /* LONGINT meta=0 nullable=0 is_null=0 */
          14. @5='00:00:27' /* TIME meta=0 nullable=0 is_null=0 */
      1. at 29516
        #120216 0:00:27 server id 152233306 end_log_pos 29543 Xid = 38657832443
        COMMIT/!/;
      2. at 29543

      __tmp_tiny_url created only on master but triggers wrote binlog so error occured on slave.

      Attachments

        Activity

          People

            Unassigned Unassigned
            lpjirasync lpjirasync (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - Not Specified
                Not Specified
                Logged:
                Time Spent - 1 day
                1d

                Smart Checklist