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://s3.51cto.com/wyfs02/M00/4A/18/wKioL1QiaFOBJGzTAAQiz6rFjBE552.jpg "style =" float: none; "Title =" 5.jpg" alt = "wkiol1qiafobjgztaaqiz6rfjbe552.jpg"/>
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M00/4A/17/wKiom1QiaDGzUh1kAABmRp0ofZE342.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.
This article is from the "hechun's technical column" blog, please be sure to keep this source http://hcymysql.blog.51cto.com/5223301/1557704
Never execute stop slave