Mysql 1864 Master-Slave error Resolution _MYSQL

Source: Internet
Author: User

The literal meaning is because the Slave_pending_jobs_size_max default value is 16777216 (16MB), but Slave received Slave_pending_jobs_size_max is 17085453 (17M) ;

Solution

Execute SQL from library as follows

Mysql>stop slave;
Mysql>set Global slave_pending_jobs_size_max=20000000;
mysql> start slave;

#在多线程复制时, the maximum memory that is occupied by the event pending in the queue is 16M, if the memory is surplus, or the delay is large, it can be adjusted properly; note

This value is larger than the max_allowed_packet of the main library.

Fault simulation:

Set from library

mysql> set global slave_parallel_workers=4;
Mysql> Show variables like ' slave_parallel_workers ';
+------------------------+-------+
| variable_name | Value |
+------------------------+-------+
|slave_parallel_workers | 4 |
+------------------------+-------+
1 row in Set (0.00SEC)
Mysql>set Global slave_pending_jobs_size_max= 1024;
Mysql> Show variables like ' slave_pend% ';
+-----------------------------+-------+
| variable_name | Value |
+-----------------------------+-------+
|slave_pending_jobs_size_max | 1024 |
+-----------------------------+-------+
1 row in Set (0.00SEC)

Main Library Operations:

mysql> Update ERP_MKPF set usnam= ' test 1864 error ';
ERROR 1197 (HY000): multi-statement transaction required more than ' max_binlog_cache_size ' bytes ofstorage; Increase this mysqld variable and try again
mysql> set global max_binlog_cache_size=8388608000000;
Query OK, 0 rowsaffected (0.00 sec)
mysql> begin;
Query OK, 0 rowsaffected (0.00 sec)
mysql> update ERP_MKPF set usnam= ' test 1864 error ';
Query OK, 70466 rowsaffected (0.38 sec)
Rows matched:70466 changed:70466 warnings:0
commit;
Query OK, 0 rowsaffected (0.08 sec)

To view the status from a library:

Mysql> show Slavestatus\g
last_sql_errno:1864
last_sql_error:cannot scheduleevent Update_rows, Relay-log name./he1-relay-bin.000005 position 494 Toworker thread because its size 8200 exceeds 1024 ofslave_pending_job S_size_max.

The above is a small set to introduce the MySQL 1864 Master-slave error solution, I hope to help you, if you have any questions please give me a message, small series will promptly reply to everyone. Here also thank you very much for the cloud Habitat Community website support!

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.