[MDEV-27547] Galera node INCONSISTENT state on DELETE with FKs having wsrep_slave_threads > 1 Created: 2022-01-19  Updated: 2022-04-08  Resolved: 2022-04-08

Status: Closed
Project: MariaDB Server
Component/s: Galera
Affects Version/s: 10.5.6
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Andrea Ponzo (Inactive) Assignee: Jan Lindström (Inactive)
Resolution: Duplicate Votes: 0
Labels: None
Environment:

CentOS Linux release 7.9.2009 (Core)


Issue Links:
Blocks
Relates
relates to MDEV-26803 Galera crash - Assertion. Possible p... Closed

 Description   

Hello,
same issue as reported on previous MENT-1129 regarding the commit order removing data on 2 tables having Foreign keys.
The Customer is the same on a different region using the Version 10.5.

[ERROR] Slave SQL: Could not execute Delete_rows_v1 event on table webdb.tasks_task; Cannot delete or update a parent row: a foreign key constraint fails (`webdb`.
`tasks_task_parents`, CONSTRAINT `tasks_task_parents_to_task_id_ca5c9a5b_fk_tasks_task_id` FOREIGN KEY (`to_task_id`) REFERENCES `tasks_task` (`id`)), Error_code: 1451; handler error HA_
ERR_ROW_IS_REFERENCED; the event's master log FIRST, end_log_pos 1331, Internal MariaDB error code: 1451
2022-01-13 21:05:02 49 [Warning] WSREP: Event 3 Delete_rows_v1 apply failed: 152, seqno 4567748838
2022-01-13 21:05:02 0 [Note] WSREP: Member 1(lhr-dc1-qt-wdb9) initiates vote on e707c4af-317b-11ec-a095-6e2d4e1c370b:4567748838,d0d48f437229894c:  Cannot delete or update a parent row: a
 foreign key constraint fails (`webdb`.`tasks_task_parents`, CONSTRAINT `tasks_task_parents_to_task_id_ca5c9a5b_fk_tasks_task_id` FOREIGN KEY (`to_task_id`) REFERENCES `tasks_task` (`id`
)), Error_code: 1451;



 Comments   
Comment by Jan Lindström (Inactive) [ 2022-01-19 ]

This is most likely duplicate of MDEV-26803 and fixed on 10.5.14. Can you try with this release?

Comment by Jan Lindström (Inactive) [ 2022-01-21 ]

aponzo Yes, it has other important fixes related to Galera and FKs.

Comment by Andrea Ponzo (Inactive) [ 2022-01-21 ]

Thank you jplindst
do you know when that version will be GA?

Andrea

Comment by Jan Lindström (Inactive) [ 2022-01-24 ]

Based on code review MDEV-26803 sets cert.optimistic_pa=NO if there is foreign keys on table used or table is referenced from other table. So it should fix this case also where DELETE of parent and child are re-ordered incorrectly because of optimistic parallel apply (pa).

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