Today, a friend of mine executed stopslave and got stuck. As a result, the kill process ID cannot be killed. This is because a large time-consuming SQL statement is executed on the master database. After receiving the SQL statement from the slave database through master-slave replication, SQL _THREAD starts to execute the SQL statement. When stopslave is executed, the SQL statement stops running, then run showslavestatusG.
Today, a friend of mine executed the stop slave command and got stuck. As a result, the kill process ID cannot be killed. This is because a large time-consuming SQL statement is executed on the master database. After receiving the SQL statement from the slave database through master-slave replication, SQL _THREAD starts to execute the SQL statement. In this case, you only need to execute the stop slave command and immediately get stuck, then run show slave status \ G;
Today, a friend of mine executed the stop slave command and got stuck. As a result, the kill process ID cannot be killed.
This is because a large time-consuming SQL statement is executed on the master database. After the master-slave replication is received from the slave database, SQL _THREAD starts to execute,
At this time, you only need to execute the stop slave command and immediately get stuck. Then, you can execute the show slave status \ G; command again and it will get stuck. You must wait.
The stop slave will end after the large SQL statement is executed, unless you pkill-9 the mysql process.
Next we will reproduce it. The master database will execute the full table update sbtest set c = 'mariadb'. After the execution, it will be recorded in the binlog log, then, when the slave database is executed, stop slave will get stuck.
650) this. width = 650; "src =" http://www.68idc.cn/help/uploads/allimg/151213/0K21911F-0.jpg "style =" float: none; "title =" 5.jpg" alt = "wKioL1QiaFOBJGzTAAQiz6rFjBE552.jpg"/>
650) this. width = 650; "src =" http://www.68idc.cn/help/uploads/allimg/151213/0K2194N6-1.jpg "style =" float: none; "title =" 6.jpg" alt = "wKiom1QiaDGzUh1kAABmRp0ofZE342.jpg"/>
Finally, we should remind you that when you execute stop slave, you must check the slow SQL statements on the master database to avoid getting stuck.