[MDEV-8648] slave processlist won't stop Created: 2015-08-19  Updated: 2015-08-19  Resolved: 2015-08-19

Status: Closed
Project: MariaDB Server
Component/s: Replication
Affects Version/s: 10.0.11, 10.0.14
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: QFY Assignee: Unassigned
Resolution: Not a Bug Votes: 0
Labels: replication
Environment:

Master:CentOS 6.2 , x86_64 , 10.0.14-MariaDB
Slave:CentOS 6.2 , x86_64 , 10.0.11-MariaDB



 Description   

Variables about gtid:

Master

MariaDB [test]> show global variables like 'gtid%';
+------------------------+----------------------------+
| Variable_name          | Value                      |
+------------------------+----------------------------+
| gtid_binlog_pos        | 123654-1234567890-23595842 |
| gtid_binlog_state      | 123654-1234567890-23595842 |
| gtid_current_pos       | 123654-1234567890-23595842 |
| gtid_domain_id         | 123654                     |
| gtid_ignore_duplicates | OFF                        |
| gtid_slave_pos         |                            |
| gtid_strict_mode       | OFF                        |
+------------------------+----------------------------+
7 rows in set (0.01 sec)

Slave

MariaDB [test]> show global variables like 'gtid%';
+------------------------+-------------------------------------------+
| Variable_name          | Value                                     |
+------------------------+-------------------------------------------+
| gtid_binlog_pos        | 0-100-44518423                            |
| gtid_binlog_state      | 0-100-44518423                            |
| gtid_current_pos       | 123654-1234567890-23595842,0-100-44518423 |
| gtid_domain_id         | 0                                         |
| gtid_ignore_duplicates | OFF                                       |
| gtid_slave_pos         | 123654-1234567890-23595842                |
| gtid_strict_mode       | OFF                                       |
+------------------------+-------------------------------------------+
7 rows in set (0.01 sec)

Step1

MariaDB [test]> change master 'm203' to master_host='x.x.x.x',master_port=3306,master_user='repl',master_password='repl',master_log_file='mariadb_binlog.000027',master_log_pos=3551;
Query OK, 0 rows affected (0.00 sec)
 
MariaDB [test]> start slave 'm203';
Query OK, 0 rows affected (0.00 sec)
 
MariaDB [test]> show slave 'm203' status \G
*************************** 1. row ***************************
               Slave_IO_State:
                  Master_Host: x.x.x.x
                  Master_User: repl
                  Master_Port: 3306
                Connect_Retry: 60
              Master_Log_File:
          Read_Master_Log_Pos: 4
               Relay_Log_File:
                Relay_Log_Pos: 540
        Relay_Master_Log_File:
             Slave_IO_Running: No
            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: 0
                   Last_Error:
                 Skip_Counter: 0
          Exec_Master_Log_Pos: 0
              Relay_Log_Space: 847
              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: 0
               Last_SQL_Error:
  Replicate_Ignore_Server_Ids:
             Master_Server_Id: 1234567890
               Master_SSL_Crl:
           Master_SSL_Crlpath:
                   Using_Gtid: No
                  Gtid_IO_Pos:
1 row in set (0.00 sec)

Step2

Master:
MariaDB [test]> select * from INFORMATION_SCHEMA.PROCESSLIST;
+-----------+------+------------------+------+-------------+------+------------------------------------------------------------------+----------------------------------------------+------------+-------+-----------+----------+-------------+---------------+----------+
| ID        | USER | HOST             | DB   | COMMAND     | TIME | STATE                                                            | INFO                                         | TIME_MS    | STAGE | MAX_STAGE | PROGRESS | MEMORY_USED | EXAMINED_ROWS | QUERY_ID |
+-----------+------+------------------+------+-------------+------+------------------------------------------------------------------+----------------------------------------------+------------+-------+-----------+----------+-------------+---------------+----------+
| 146960605 | repl | x.x.x.x:35054 | NULL | Binlog Dump |  239 | Master has sent all binlog to slave; waiting for binlog to be up | NULL                                         | 239407.436 |     0 |         0 |    0.000 |       50552 |             0 | 93725667 |
| 146960598 | root | localhost        | test | Query       |    0 | Filling schema table                                             | select * from INFORMATION_SCHEMA.PROCESSLIST |      8.723 |     0 |         0 |    0.000 |       82928 |             0 | 93725684 |
+-----------+------+------------------+------+-------------+------+------------------------------------------------------------------+----------------------------------------------+------------+-------+-----------+----------+-------------+---------------+----------+
2 rows in set (0.01 sec)

Step3

Slave:
MariaDB [test]> stop slave 'm203';
Query OK, 0 rows affected (0.00 sec)
 
MariaDB [test]> reset slave 'm203';
Query OK, 0 rows affected (0.00 sec)

Step4

MariaDB [test]> select * from INFORMATION_SCHEMA.PROCESSLIST;
+-----------+------+------------------+------+-------------+------+------------------------------------------------------------------+----------------------------------------------+-------------+-------+-----------+----------+-------------+---------------+----------+
| ID        | USER | HOST             | DB   | COMMAND     | TIME | STATE                                                            | INFO                                         | TIME_MS     | STAGE | MAX_STAGE | PROGRESS | MEMORY_USED | EXAMINED_ROWS | QUERY_ID |
+-----------+------+------------------+------+-------------+------+------------------------------------------------------------------+----------------------------------------------+-------------+-------+-----------+----------+-------------+---------------+----------+
| 146960605 | repl | x.x.x.x:35054 | NULL | Binlog Dump | 1292 | Master has sent all binlog to slave; waiting for binlog to be up | NULL                                         | 1292957.034 |     0 |         0 |    0.000 |       50552 |             0 | 93725667 |
| 146960598 | root | localhost        | test | Query       |    0 | Filling schema table                                             | select * from INFORMATION_SCHEMA.PROCESSLIST |       0.406 |     0 |         0 |    0.000 |       82928 |             0 | 93725715 |
+-----------+------+------------------+------+-------------+------+------------------------------------------------------------------+----------------------------------------------+-------------+-------+-----------+----------+-------------+---------------+----------+
2 rows in set (0.00 sec)

when I stop slave and reset slave ,but slave thread in master isn't closed!

Through it is not critical,But I think thread in master should be close when slave reset slave thread;



 Comments   
Comment by Elena Stepanova [ 2015-08-19 ]

It cannot be closed when the slave is reset, because the slave can be reset only when it's stopped, and if it's stopped, naturally it cannot communicate to the master to let it know it's being reset.

But the Binlog Dump thread will stop eventually, even if you did not reset the slave, but only stopped it (of if the slave aborted, or the network connection was broken). The thread's life expectancy depends on MASTER_HEARTBEAT_PERIOD which your slave connection was configured with last time you connected to the master (by default it's 1800 seconds, you can set it to a lower value to experiment).

Generated at Thu Feb 08 07:28:44 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.