Error
Error Code:
1840
MariaDB Error 1840: GTID_PURGED Not Empty
Description
This error occurs when you attempt to set the `@@GLOBAL.GTID_PURGED` variable on a MariaDB server. It specifically means that the `@@GLOBAL.GTID_EXECUTED` variable, which tracks transactions executed by the server, is not empty. MariaDB prevents this operation to maintain data integrity and avoid potential replication inconsistencies.
Error Message
@@GLOBAL.GTID_PURGED can only be set when @@GLOBAL.GTID_EXECUTED is empty.
Known Causes
3 known causesTransactions Already Executed
The MariaDB server has already processed transactions, populating the `GTID_EXECUTED` set and preventing `GTID_PURGED` from being set.
Incorrect Replication Setup
This error frequently occurs during initial replication setup or when re-configuring replication without properly clearing GTID states.
Improper GTID State Management
Attempting to manually synchronize or manipulate GTID states on a server that has an active execution history can trigger this error.
Solutions
Coming SoonGeneral Troubleshooting Tips
- Check the error message carefully for specific details
- Review recent changes that might have caused the error
- Search for the exact error code in the official documentation
- Check log files for additional context
- Try restarting the application or service