3659
MariaDBERRORNotableReplicationHIGH confidence

Replica wait for primary timeout exceeded

Production Risk

Medium — Read-after-write consistency wait fails; application may read stale data.

How to reproduce
trigger — this will error
trigger — this will error
SELECT WAIT_FOR_EXECUTED_GTID_SET('source_uuid:1-1000', 5); -- times out after 5 seconds

expected output

ERROR 3659 (HY000): Timeout exceeded waiting for replica to execute GTID set.

Fix 1

Increase wait timeout

Increase wait timeout
SELECT WAIT_FOR_EXECUTED_GTID_SET('source_uuid:1-1000', 60); -- 60-second timeout

Why this works

Allows more time for the replica to catch up before returning an error.

Fix 2

Check replica lag

Check replica lag
SHOW REPLICA STATUS\G

Why this works

Reveals current Seconds_Behind_Source and any blocking errors.

What not to do

Version notes

Sources
Official documentation ↗

MySQL 8.0 — 3659 ER_REPLICA_WAIT_TIMEOUT_EXCEEDED

Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev

← All MariaDB errors