I
I
Ivan Kiselev2014-08-07 08:52:42
MySQL
Ivan Kiselev, 2014-08-07 08:52:42

MySQL replication problem: what could be the cause of the stuck Exec_Master_Log_Pos value?

Good afternoon.
Used:
* Debian 7
* mysql-server 5.5.35 (the version is the same for master and slave)
The replication scheme is simple: Master -> Slave.
More than 20 bases are replicated.
I will give the state of replication:

mysql> SHOW SLAVE STATUS\G
*************************** 1. row ***************************
               Slave_IO_State: Waiting for master to send event
                  Master_Host: xx.xx.xx.xx
                  Master_User: xxxx
                  Master_Port: 3306
                Connect_Retry: 60
              Master_Log_File: replication.002482
          Read_Master_Log_Pos: 88152027
               Relay_Log_File: relay.000002
                Relay_Log_Pos: 255
        Relay_Master_Log_File: replication.002448
             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: 1325184
              Relay_Log_Space: 3587449690
              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: 210412
Master_SSL_Verify_Server_Cert: No
                Last_IO_Errno: 0
                Last_IO_Error: 
               Last_SQL_Errno: 0
               Last_SQL_Error: 
  Replicate_Ignore_Server_Ids: 
             Master_Server_Id: 144765184
1 row in set (0.00 sec)

At a certain point in time, the monitoring system reported a fairly large backlog.
The reason for this is that the slave does not apply binlogs on itself, getting stuck at the same Exec_Master_Log_Pos value and never increasing it again.
The rest of the indicators are normal: the binlogs are being read, there is a connection with the master.
What was unsuccessfully attempted:
* STOP SLAVE / START SLAVE;
* RESET SLAVE;
* Restart the MySQL server on the slave.
What I would like to avoid without finding out the causes of the current problem:
* Re-initialization of replication by removing the dump from the master and re-uploading it to the slave.
I also drew attention to
Relay_Log_Pos: 255
Extracted the corresponding entries from the relay logs:
# at 255                                                                                                                                                                                             
#140805  2:11:33 server id 144765189  end_log_pos 1325257       Query   thread_id=154873        exec_time=63    error_code=0                                                                         
SET TIMESTAMP=1407179493/*!*/;                                                                                                                                                                       
SET @@session.pseudo_thread_id=154873/*!*/;                                                                                                                                                          
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;                                                                            
SET @@session.sql_mode=0/*!*/;                                                                                                                                                                       
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;                                                                                                                    
/*!\C utf8 *//*!*/;                                                                                                                                                                                  
SET @@session.character_set_client=33,@@session.collation_connection=192,@@session.collation_server=192/*!*/;                                                                                        
SET @@session.lc_time_names=0/*!*/;                                                                                                                                                                  
SET @@session.collation_database=DEFAULT/*!*/;                                                                                                                                                       
BEGIN                                                                                                                                                                                                
/*!*/;                                                                                                                                                                                               
# at 328                                                                                                                                                                                             
# at 394                                                                                                                                                                                             
# at 1412                                                                                                                                                                                            
# at 2430                                                                                                                                                                                            
# at 3448                                                                                                                                                                                            
# at 4466                                                                                                                                                                                            
# at 5484                                                                                                                                                                                            
# at 6502                                                                                                                                                                                            
# at 7520                                                                                                                                                                                            
# at 8538                                                                                                                                                                                            
# at 9556                                                                                                                                                                                            
# at 10574                                                                                                                                                                                           
# at 11594                                                                                                                                                                                           
# at 12612                                                                                                                                                                                           
# at 13630                                                                                                                                                                                           
# at 14648                                                                                                                                                                                           
# at 15666                                                                                                                                                                                           
# at 16684                                                                                                                                                                                           
# at 17702

However, I have no idea which way to look at them.
To the person who will give the best answer - in the evening I will record a guitar cover of some good song.
I would appreciate everyone's help and advice!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
nikoinlove, 2014-08-11
@nikoinlove

Maybe he's stuck on some big request.
What can be seen on the slave in show processlist; about replication?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question