How to Fix MySQL Error 1864 (ER_MTS_EVENT_BIGGER_PENDING_JOBS_SIZE_MAX)
You see mysql error 1864 when a replication event is larger than the replica memory limit. You can fix this issue by raising the maximum pending jobs size on your replica server. This problem stops data changes from moving from your source database to your replica nodes. Your read nodes will show stale data until a database admin fixes the replication stream. Fast recovery requires safe access to the replica settings without risking data integrity. What causes mysql error 1864 in replication
Your coding agents run with your access.
Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.
You see mysql error 1864 when a replication event is larger than the replica memory limit. You can fix this issue by raising the maximum pending jobs size on your replica server.
This problem stops data changes from moving from your source database to your replica nodes. Your read nodes will show stale data until a database admin fixes the replication stream. Fast recovery requires safe access to the replica settings without risking data integrity.
What causes mysql error 1864 in replication
MySQL uses worker threads to apply data changes on replica servers in parallel. The database engine tracks this failure using the symbol ER_MTS_EVENT_BIGGER_PENDING_JOBS_SIZE_MAX and SQLSTATE HY000. The coordinator thread reads events from the relay log and sends them to worker queues. Every replica sets a hard memory cap for these pending worker events. When a single event exceeds that cap, the coordinator cannot schedule it to a worker thread.
The server logs a clear message with the relay log name and the exact byte position. It also lists the size of the huge event alongside the current replica pending limit. Huge transactions on the source database are the main cause of this replication stop. For example, a developer might update millions of rows in one big batch job. Row-based replication turns that single batch into a massive binary log event.
Large binary objects, such as files or images stored in tables, also trigger this limit. The source server writes the data with ease if its packet size limit is high. The failure only shows up later when the replica tries to process the relay log. At that point, the SQL thread stops right away to prevent memory exhaustion on the replica.
How to diagnose and fix the replica limit
First, check the replica status output or the error log on the broken database node. Look at the exact byte size reported in the error message for the blocked event. You must set the replica pending jobs size limit higher than that specific event size. Before you change the setting, check the free RAM on the replica host machine.
MySQL Access Governance + End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Raising this memory limit too high can cause the operating system to kill the database process. Once you pick a safe number, stop the replication worker threads on the replica node. Next, update the global system variable that controls the maximum size for pending replica jobs. Start the replication threads again and check that the worker queue processes the stuck relay log.
After the replica catches up, update your main database settings file on disk. This step keeps the new memory limit in place if the database server restarts later. Do not grant full admin rights to every engineer just to run these recovery checks. Limit high-level variable changes to approved roles so nobody skips transactions by mistake. Skipping a blocked transaction causes data drift between your source node and your replica server.
How to prevent large event failures
You can avoid this error by changing how your app writes large data batches. Ask developers to break big updates and deletes into smaller chunks of a few thousand rows. Smaller transactions create smaller binary log events that fit inside standard worker memory queues. You should also keep the maximum packet size and the replica job limit aligned across nodes. When source limits and replica memory limits match, oversized events will not halt your replication workers.
Inspect every MySQL query and response in flight
Static grants and network rules block bad logins. They cannot pause a risky query for review or mask emails in a result set. By design, hoop.dev sits inline in the MySQL protocol as a sidecar for your MySQL. For every plain query, prepared statement, or cursor an agent or human runs in production, hoop.dev decides to pass, mask, block, or hold it for review.
First, hoop.dev guardrails block banned actions before MySQL runs them, and an AI Analyzer you configure can score intent or escalate for approval. Next, hoop.dev data masking rewrites sensitive string columns in results in memory, and every verdict goes to the audit trail. Find the open-source binary on GitHub.
Frequently asked questions
Does mysql error 1864 cause data loss on the replica?
No, the error only pauses the worker threads before they apply the large event. The data stays safe inside the relay log until you raise the memory limit.
Can I fix this error without restarting the MySQL server?
Yes, an admin can stop the replica threads and change the limit in memory. You then start the replica threads again, and replication continues without a full reboot.
Why did the source database allow a query that broke the replica?
The source database checks packet size limits, while the replica checks worker queue memory limits. If the worker queue limit is smaller than the packet limit, large events will fail.
Related guides
In this post