MySQL master-slave slave-skip-errors and Sql_slave_skip_counter

Source: Internet
Author: User
Tags mysql version

In general, for the sake of insurance, in the master-slave maintenance, sometimes you need to skip a command that cannot be executed, you need to execute set global sql_slave_skip_counter=1 to skip the command when slave is in the stop state. However, in a test and development environment, sometimes for quick resolution without impacting development, you need to use set global sql_slave_skip_counter=n, which means to skip N event from the current position at start slave. Each event is skipped, then n--.

This is still very good verification, testing has a clear experience, do not want to test the reference to the next http://www.cnblogs.com/yhlx/articles/3740598.html.

In addition to skipping N event, an important parameter is slave-skip-errors, which has four available values: Off, all, Erorcode, ddl_exist_errors.

They can be known for their usage based on each worthy literal meaning, but the ddl_exist_errors value is quite special, which represents a set of errorcode combinations, namely:

1007: Database already exists, database creation failed
1008: Database does not exist, delete database failed
1050: Data table already exists, failed to create data table
1050: Data table does not exist, delete data table failed
1054: The field does not exist, or the program file conflicts with the database
1060: Duplicate field, resulting in unable to insert
1061: Duplicate Key Name
1068: multiple primary keys defined
1094: Location Thread ID
1146: Data table is missing, please restore database

However, it is also important to note that this value is only available in MySQL version cluster mysqld and not in the MySQL server version of mysqld.

Use this parameter in addition to the bugs mentioned by http://blog.csdn.net/wulantian/article/details/38369259 and http://bugs.mysql.com/bug.php?id=39393, What is more serious is that it allows neglected operations to be overlooked, which in turn leads to incorrect business, especially if a real-time profit-and-loss alert based on real-time wind control and programmatic operations is available from the library, for example, in the case of operations that provide the same level of service as the main library, for which some manufacturers even have millions of claims.

MySQL master-slave slave-skip-errors and Sql_slave_skip_counter

Related Article

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.