Databases 6 min read

Resolving MySQL Replication Failure Caused by max_binlog_cache_size Misconfiguration

This article describes a MySQL replication outage caused by an incorrectly set max_binlog_cache_size parameter, explains the underlying mechanism of binlog caching, and provides a step‑by‑step solution to adjust the setting and restore normal replication.

Aikesheng Open Source Community
Aikesheng Open Source Community
Aikesheng Open Source Community
Resolving MySQL Replication Failure Caused by max_binlog_cache_size Misconfiguration

In daily operations, unexpected online issues often stem from misconfigurations. Recently the DMP database operation platform reported a master‑slave replication error where the SQL thread was disconnected due to an abnormal parameter setting.

The alert indicated that the MySQL replica's SQL thread had stopped. Running show slave status\G confirmed the thread was halted. Further inspection with

select * from performance_schema.replication_applier_status_by_worker;

showed the error message about exceeding max_binlog_cache_size.

The error pointed to the max_binlog_cache_size variable being improperly set. The master had 10 GB while the replica only 10 MB, causing the replication failure.

According to MySQL documentation, binlog records all data‑modifying operations. In replication, the master sends its binlog to the slave. max_binlog_cache_size limits the total binlog cache for all clients; when a multi‑statement transaction exceeds this limit, the error occurs. The related binlog_cache_size allocates cache per client.

The mismatch was resolved by increasing the replica’s max_binlog_cache_size dynamically: mysql> set global max_binlog_cache_size=10240000000; After adjusting the value and restarting replication, the system returned to normal.

Proper configuration and timely adjustment of MySQL parameters are essential for system stability and performance; administrators should understand the semantics of replication‑related variables and keep them consistent across master and slave to avoid production incidents.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

databasemysqlReplicationmax_binlog_cache_size
Aikesheng Open Source Community
Written by

Aikesheng Open Source Community

The Aikesheng Open Source Community provides stable, enterprise‑grade MySQL open‑source tools and services, releases a premium open‑source component each year (1024), and continuously operates and maintains them.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.