My mysql replication (master - slave) is failing with following error:
Last_SQL_Errno: 1062
Last_SQL_Error: Coordinator stopped because there were error(s) in the worker(s). The most recent failure being: Worker 1 failed executing transaction 'ANONYMOUS' at source log mysql-bin.000115, end_log_pos 468117420. See error log and/or performance_schema.replication_applier_status_by_worker table for more details about this failure or others, if any.
I checked the bin log file and I see following
2024-12-03T21:48:34.088063Z 7 [ERROR] [MY-010584] [Repl] Replica SQL for channel '': Worker 1 failed executing transaction 'ANONYMOUS' at source log mysql-bin.000123, end_log_pos 515; Could not execute Write_rows event on table mydb.wp_options; Duplicate entry '_transient_jetpack_update_remote_package_last_query' for key 'wp_options.option_name', Error_code: 1062; handler error HA_ERR_FOUND_DUPP_KEY; the event's source log mysql-bin.000123, end_log_pos 515, Error_code: MY-001062
2024-12-03T21:48:34.088873Z 6 [ERROR] [MY-010586] [Repl] Error running query, replica SQL thread aborted. Fix the problem, and restart the replica SQL thread with "START REPLICA". We stopped at log 'mysql-bin.000123' position 157
The problematic database is a WordPress database.
How do I fix it and also avoid this happening in the future as I've many wordPress databases and I'll have more in the future.