Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-12038

Replication is stuck on a wrongly formated Binlog

    XMLWordPrintable

Details

    Description

      Sql thread is running on the slave but seems to be blocked on a specific position.

      when looking at that position on the master , the format seems to be broken (overlap between #at and end_log_pos lines:

      MariaDB [(none)]> show slave status\G
      *************************** 1. row ***************************
                     Slave_IO_State: Waiting for master to send event
                        Master_Host: 10.193.9.31
                        Master_User: repl
                        Master_Port: 3306
                      Connect_Retry: 60
                    Master_Log_File: mysql-bin.001976
                Read_Master_Log_Pos: 2042964
                     Relay_Log_File: slave-relay.000004
                      Relay_Log_Pos: 66666208
              Relay_Master_Log_File: mysql-bin.001965
                   Slave_IO_Running: Yes
                  Slave_SQL_Running: Yes
                    Replicate_Do_DB:
                Replicate_Ignore_DB:
                 Replicate_Do_Table:
             Replicate_Ignore_Table:
            Replicate_Wild_Do_Table:
        Replicate_Wild_Ignore_Table:
                         Last_Errno: 0
                         Last_Error:
                       Skip_Counter: 0
                Exec_Master_Log_Pos: 66665920
      

      On the master:

       mysqlbinlog -v mysql-bin.001965
       
      # at 66665893
      #170208 17:51:24 server id 1  end_log_pos 66665920      Xid = 4949069
      COMMIT/*!*/;
      # at 66665920
      #170208 17:51:21 server id 1  end_log_pos 66665958      GTID 0-1-21861609 trans
      /*!100001 SET @@session.gtid_seq_no=21861609*//*!*/;
      BEGIN
      /*!*/;
      # at 66665958
      #170208 17:51:21 server id 1  end_log_pos 66666035      Table_map: `customers`.`pmig_contracts_contractperiod` mapped to number 832
      # at 66666035
      # at 66667051
      # at 66668067
      # at 66669083
      # at 66670099
      # at 66671115
      # at 66672131
      # at 66673147
      # at 66674163
      # at 66675179
      # at 66676195
      # at 66677211
      # at 66678227
      # at 66679243
      # at 66680259
      # at 66681275
      # at 66682291
      # at 66683307
      ...
      # at 93191763
      # at 93192779
      # at 93193795
      # at 93194811
      # at 93195827
      # at 93196843
      # at 93197859
      #170208 17:51:21 server id 1  end_log_pos 66667051      Update_rows: table id 832
      #170208 17:51:21 server id 1  end_log_pos 66668067      Update_rows: table id 832
      #170208 17:51:21 server id 1  end_log_pos 66669083      Update_rows: table id 832
      #170208 17:51:21 server id 1  end_log_pos 66670099      Update_rows: table id 832
      #170208 17:51:21 server id 1  end_log_pos 66671115      Update_rows: table id 832
      #170208 17:51:21 server id 1  end_log_pos 66672131      Update_rows: table id 832
      #170208 17:51:21 server id 1  end_log_pos 66673147      Update_rows: table id 832
      #170208 17:51:21 server id 1  end_log_pos 66674163      Update_rows: table id 832
      #170208 17:51:21 server id 1  end_log_pos 66675179      Update_rows: table id 832
      ...
      #170208 17:51:21 server id 1  end_log_pos 93196843      Update_rows: table id 832
      #170208 17:51:21 server id 1  end_log_pos 93197859      Update_rows: table id 832
      #170208 17:51:21 server id 1  end_log_pos 93198671      Update_rows: table id 832 flags: STMT_END_F
      ...
      ### UPDATE `customers`.`pmig_contracts_contractperiod`
      ### WHERE
      ###   @1=5726323
      ###   @2=99.00
      ###   @3=0.00
      ###   @4=12
      ### SET
      ###   @1=5726323
      ###   @2=99.00
      ###   @3=8.25
      ###   @4=12
      ### UPDATE `customers`.`pmig_contracts_contractperiod`
      ### WHERE
      ###   @1=5726325
      ###   @2=49.00
      ###   @3=0.00
      ###   @4=24
      ### SET
      ###   @1=5726325
      ###   @2=49.00
      ###   @3=2.04
      ###   @4=24
      # at 93198671
      #170208 17:51:21 server id 1  end_log_pos 93198698      Xid = 4947268
      COMMIT/*!*/;
      

      => Everything seems to be in the file, but not in the correct order. Slave is not complaining but does nothing

      MariaDB [(none)]> show processlist;
      +-----+-------------+-------------------+------+-------------+-------+--------------------------------------------------------------------------------+------------------+----------+
      | Id  | User        | Host              | db   | Command     | Time  | State                                                                          | Info             | Progress |
      +-----+-------------+-------------------+------+-------------+-------+--------------------------------------------------------------------------------+------------------+----------+
      |   8 | repl        | 10.193.9.23:51741 | NULL | Binlog Dump | 96271 | Master has sent all binlog to slave; waiting for binlog to be updated          | NULL             |    0.000 |
      | 142 | system user |                   | NULL | Connect     | 87110 | Waiting for master to send event                                               | NULL             |    0.000 |
      | 340 | system user |                   | NULL | Connect     | 54207 | Waiting for prior transaction to start commit before starting next transaction | NULL             |    0.000 |
      | 341 | system user |                   | NULL | Connect     | 54207 | Waiting for prior transaction to start commit before starting next transaction | NULL             |    0.000 |
      | 342 | system user |                   | NULL | Connect     | 54207 | Waiting for prior transaction to start commit before starting next transaction | NULL             |    0.000 |
      | 343 | system user |                   | NULL | Connect     | 54207 | Waiting for prior transaction to start commit before starting next transaction | NULL             |    0.000 |
      | 344 | system user |                   | NULL | Connect     | 54207 | Waiting for prior transaction to start commit before starting next transaction | NULL             |    0.000 |
      | 345 | system user |                   | NULL | Connect     | 54207 | Waiting for prior transaction to start commit before starting next transaction | NULL             |    0.000 |
      | 346 | system user |                   | NULL | Connect     | 54207 | Waiting for prior transaction to start commit before starting next transaction | NULL             |    0.000 |
      | 347 | system user |                   | NULL | Connect     |     5 | Update_rows_log_event::find_row(-1)                                            | NULL             |    0.000 |
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              pmoiroux Patrick Moiroux
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.