How to Fix MySQL Error 4022 (ER_GRP_RPL_RECOVERY_CHANNEL_STILL_RUNNING)
You see mysql error 4022 when a group replication recovery channel cannot stop. You fix it by finding and ending the query that holds a database or table lock. In the database log, this issue appears as ER_GRP_RPL_RECOVERY_CHANNEL_STILL_RUNNING with SQLSTATE HY000. The engine states that the recovery channel is still running and waits for a lock. When a node joins a cluster, it runs distributed recovery to catch up on missed changes. If a local transaction blocks that channel, the node cannot f
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 4022 when a group replication recovery channel cannot stop. You fix it by finding and ending the query that holds a database or table lock.
In the database log, this issue appears as ER_GRP_RPL_RECOVERY_CHANNEL_STILL_RUNNING with SQLSTATE HY000. The engine states that the recovery channel is still running and waits for a lock. When a node joins a cluster, it runs distributed recovery to catch up on missed changes. If a local transaction blocks that channel, the node cannot finish recovery or shut down the channel.
What causes mysql error 4022 in cluster nodes
A joining node opens a special recovery channel to pull missing transactions from a donor node. Once the node catches up, the engine tries to close this temporary channel. If an open query holds a lock on the joining node, the channel hangs. The engine then logs mysql error 4022 because the recovery worker cannot finish its task.
Metadata locks are the most common culprit behind this specific failure. An admin tool or reporting app might run a long read query on the joining member. That read query holds a metadata lock on a table that the recovery channel must alter. Until the local session releases that lock, the recovery applier thread stays stuck in a waiting state.
Explicit table locks and uncommitted write transactions on the member also trigger this state. Even a small schema inspection from a monitoring script can block a pending schema change in the recovery queue. Network drops do not cause this code directly, as the issue lives inside the local lock manager.
How to diagnose and fix the lock safely
Start by checking the active process list and lock wait tables on the affected node. Look for the recovery applier thread and see which table or row lock it wants. Next, find the local client session that holds that exact lock right now.
Do not restart the database service or grant full superuser rights to fix this issue. A hard restart during group recovery leaves the node out of sync and extends downtime. Instead, use a scoped admin role that only has permission to view and end active queries.
MySQL Access Governance + End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Once you find the blocking session, check if it is a safe read query or an idle transaction. End that specific blocking session so the recovery channel can grab the lock and finish. After the lock clears, the recovery channel closes on its own and the node joins the cluster.
How to prevent recovery channel lock waits
Keep client apps and reporting tools off a node until it finishes joining the group. If apps read from a node while it recovers, they create lock conflicts with incoming donor changes. Route all traffic only to healthy online nodes that have already completed distributed recovery.
You should also restrict direct human queries on cluster members during maintenance windows. Engineers who check table status during a join often hold the very locks that stall recovery. Set short lock wait timeouts for ad-hoc sessions so idle queries drop before they block replication.
Check MySQL queries and results on the wire
MySQL grants control who logs in. They do not check single queries or mask sensitive columns once a session starts. With hoop.dev, you run an open-source proxy, a sidecar for your MySQL, inline in the MySQL wire protocol. On every query an AI agent or human runs against production MySQL, RDS, or Aurora, hoop.dev decides to pass, mask, block, or hold it for review.
Multi-statement batches and prepared queries are split and checked one by one by hoop.dev guardrails, which refuse banned queries with a native MySQL error or hold risky ones for approval. On the response path, hoop.dev data masking rewrites string values in returned rows in memory, and every decision is logged. See the MIT-licensed project on GitHub.
Frequently asked questions
What does ER_GRP_RPL_RECOVERY_CHANNEL_STILL_RUNNING mean?
It means the group replication recovery channel is still running on the database node. The channel is almost always waiting for a database or table lock to clear.
Is it safe to kill the recovery channel thread directly?
No, you should never kill the replication recovery thread itself. Instead, find and end the separate client query that holds the blocking table lock.
Why does a read query block the group replication recovery channel?
An open read query holds a metadata lock on the table it reads. If the recovery channel needs to apply a schema change to that table, it must wait.
Related guides
In this post