[MDEV-21055] Maria replication with GTID fails Created: 2019-11-14  Updated: 2020-04-03  Resolved: 2019-12-24

Status: Closed
Project: MariaDB Server
Component/s: Replication
Affects Version/s: 10.3.18
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Catalin Dumitriu Assignee: Unassigned
Resolution: Incomplete Votes: 0
Labels: need_feedback
Environment:

debian 9



 Description   

Slave configured with GTID crashed because of :

2019-11-11 21:29:23 9291 [ERROR] Slave SQL: Could not execute Update_rows_v1 event on table magazine.user_master; Duplicate entry '711407' for key 'PRIMARY', Error_code: 1062; handler error HA_ERR_FOUND_DUPP_KEY; the event's master log mysql-bin.065811, end_log_pos 441166884, Gtid 0-122-179115583, Internal MariaDB error code: 1062
2019-11-11 21:29:23 9291 [Warning] Slave: Duplicate entry '711407' for key 'PRIMARY' Error_code: 1062
2019-11-11 21:29:23 9291 [ERROR] Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with "SLAVE START". We stopped at log 'mysql-bin.065811' position 441165623; GTID position '0-122-179115582'
2019-11-11 21:29:23 9291 [Note] Slave SQL thread exiting, replication stopped in log 'mysql-bin.065811' at position 441165623; GTID position '0-122-179115582'

The slave is read only, with 2 accounts root and user for replication. Binlog format is row for master and log.
After checking master binary log i found this:

UPDATE `user_master` SET `delivery_method` = 3 WHERE `num` = 711407 GTID 0-122-179115579
UPDATE `user_master` SET `delivery_method` = 10 WHERE `num` = 711407 GTID 0-122-179115580
UPDATE `user_master` SET `delivery_method` = 3 WHERE `num` = 711407 GTID 0-122-179115581
UPDATE `user_master` SET `delivery_method` = 10 WHERE `num` = 711407 GTID 0-122-179115582
UPDATE `user_master` SET `delivery_method` = 3 WHERE `num` = 711407 GTID 0-122-179115583

Where to start investigating this ? At what to look for this situations ?



 Comments   
Comment by Alice Sherepa [ 2019-11-15 ]

Could you please add your configuration files and error log. This could be related to MDEV-20605, but maybe not, that bug wasn't repeatable with row format.

Comment by Catalin Dumitriu [ 2020-04-03 ]

Sorry for late comment, the problem was related to system versioning activated on those tables. Duplicate entry error is in fact related to inserting in history. Setting secure timestamp on slave solved the problem.

Generated at Thu Feb 08 09:04:15 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.