Events in Replicated Environments
Events run on every server unless disabled on replicas. The ORIGINATOR field tracks which server created an event to avoid duplicate execution.
Events run on every server unless disabled on replicas. The ORIGINATOR field tracks which server created an event to avoid duplicate execution.
-- Check event originator (server_id that created the event)
SELECT event_name, originator FROM information_schema.events;
-- On replica, disable all events:
SET GLOBAL event_scheduler = OFF;
-- Or disable specific event on replica after failover:
ALTER EVENT daily_cleanup ENABLE; -- only on new primary
-- my.cnf approach (disable events globally on replicas):
-- event_scheduler = OFF
-- Only enable on the primary server
After a failover, manually enable events on the new primary — do not run them on both simultaneously.