Never execute stop slave

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.