[MDEV-31833] replication breaks when using optimistic replication and replica is a galera node Created: 2023-05-17  Updated: 2023-09-28  Resolved: 2023-09-12

Status: Closed
Project: MariaDB Server
Component/s: Galera, Replication
Affects Version/s: None
Fix Version/s: 10.5.23, 10.6.16, 10.10.7, 10.11.6, 11.0.4, 11.1.3

Type: Bug Priority: Critical
Reporter: Rick Pizzi Assignee: Julius Goryavsky
Resolution: Fixed Votes: 7
Labels: triage

Attachments: File master1_n1.cnf     File master1_n2.cnf     File master2_n1.cnf     File master2_n2.cnf     File transactions.yy     File transactions.zz    
Issue Links:
Duplicate
Relates
relates to MDEV-10962 Deadlock with 3 concurrent DELETEs by... Closed

 Description   

When a galera node is a replica of an upstream cluster it is impossible to enable optimistic replication, because the expected conflicts that stem from this replication mode will cause galera code to immediately abort replication.

2023-05-17 13:57:20 6930586 [Note] WSREP: ha_rollback_trans(6930586) rolled back: Deadlock found when trying to get lock; try restarting transaction; is_real 0
2023-05-17 13:57:20 6930586 [Note] WSREP: ha_rollback_trans(6930586) rolled back: Deadlock found when trying to get lock; try restarting transaction; is_real 1
2023-05-17 13:57:20 6930586 [Note] WSREP: SQL apply failed, res 149 conflict state: aborted
2023-05-17 13:57:20 6930586 [ERROR] Slave SQL: Node has dropped from cluster, Gtid 0-8174-126467367555, Internal MariaDB error code: 1047



 Comments   
Comment by Seppo Jaakola [ 2023-06-28 ]

It looks that the error returned from optimistic async replication applying conflicts is treated as galera cluster failure. The failure should instead be returned to optimistic replication control, where retrying should be handled. I will prepare a pull request for refactoring this failure handling.

Comment by Jan Lindström [ 2023-08-16 ]

https://github.com/MariaDB/server/pull/2721

Comment by Julius Goryavsky [ 2023-09-12 ]

Fixed, https://github.com/MariaDB/server/commit/a3cbc44b24ec467f33e445f57e2022e038b88623

Generated at Thu Feb 08 10:26:49 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.