Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to deal with the error report of the main database when using MySQL5.7 semi-synchronous replication

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

The following content mainly brings you to use MySQL 5.7 semi-synchronous replication found that the master library error how to deal with, here mentioned knowledge, and books slightly different, are professional and technical personnel in contact with users in the process, summed up, has a certain experience sharing value, hope to bring help to the majority of readers.

When using MySQL 5.7 semi-synchronous replication, it was found that a simple write operation to the main library would execute 1s, which was caused by semi-synchronous analysis through show profile analysis.

Check the master-slave log and find the error as follows:

Error reported by master library:

2018-05-21T05:34:06.955592Z 0 [ERROR] /usr/local/mysql-5.7.21-linux-glibc2.12-x86_64/bin/mysqld: Got an error reading communication packets

2018-05-21T05:34:06.967776Z 21 [Note] While initializing dump thread for slave with UUID , found a zombie dump thread with the same UUID. Master is killing the zombie dump thread(20).

2018-05-21T05:34:06.967864Z 20 [Note] Stop semi-sync binlog_dump to slave (server_id: 12233306)

2018-05-21T05:34:06.967954Z 21 [Note] Start binlog_dump to master_thread_id(21) slave_server(12233306), pos(mysql-bin.000004, 484)

2018-05-21T05:34:07.957450Z 21 [Note] Start semi-sync binlog_dump to slave (server_id: 12233306), pos(mysql-bin.000004, 484)

error reported from the library

2018-05-21T05:54:29.787788Z 4 [ERROR] Error reading packet from server for channel '': Lost connection to MySQL server during query (server_errno=2013)

2018-05-21T05:54:29.787880Z 4 [Note] Slave I/O thread: Failed reading log event, reconnecting to retry, log 'mysql-bin.000004' at position 484 for channel ''

2018-05-21T05:54:29.787908Z 4 [Warning] Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.

After preliminary analysis, only semi-synchronization will trigger this problem, then it should be a bug in the ACK packet returned from the slave library, the master library cannot be parsed, finally after adjusting the parameters, confirm that under semi-synchronization, only the slave library enables the parameter slave_compressed_protocol. The official default parameter is OFF.

a.5.7 b. slave_compressed_protocol=1 c. master-slave semi-synchronization

The problem is confirmed as 5.7 bug, which has been mentioned, but there are still few cases online.

https://bugs.mysql.com/bug.php? id=85382

Upper experimental diagram:

normal

Trigger bug

Workaround: Set slave_compressed_protocol=0 from the library

For the above on the use of MySQL 5.7 semi-synchronous replication found that the master database error how to deal with, if you still need to know more can continue to pay attention to our industry push new, if you need to get professional answers, you can contact the official website pre-sales after-sales, I hope this article can bring you a certain knowledge update.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report