[MDEV-26062] InnoDB: WSREP: referenced FK check fail: Lock wait index `PRIMARY` table `schema`.`child_table` Created: 2021-07-01  Updated: 2021-10-07  Resolved: 2021-07-27

Status: Closed
Project: MariaDB Server
Component/s: Galera, Storage Engine - InnoDB
Affects Version/s: 10.3.21
Fix Version/s: 10.2.40, 10.3.31, 10.4.21, 10.5.12, 10.6.4

Type: Bug Priority: Major
Reporter: Pramod Mahto Assignee: Jan Lindström (Inactive)
Resolution: Fixed Votes: 0
Labels: foreign-keys

Issue Links:
Relates
relates to MDEV-18562 [ERROR] InnoDB: WSREP: referenced FK ... Closed

 Description   

Occasionally receiving error:

 
2021-06-30  4:13:15 376165477 [ERROR] InnoDB: WSREP: referenced FK check fail: Lock wait index `PRIMARY` table  `schema`.`child_table`
2021_06_30_051001 [Note] Full-Backup Start
2021-06-30  5:12:03 0 [Note] WSREP: Member 0.0 (node1) desyncs itself from group
2021-06-30  5:12:03 0 [Note] WSREP: Shifting SYNCED -> DONOR/DESYNCED (TO: 738363159)
2021-06-30  5:12:03 376235117 [Note] WSREP: Provider paused at 991736fe-3886-11ea-9cdb-0bada3df9cd4:738363159 (362396096)
2021-06-30  5:12:04 376235117 [Note] WSREP: resuming provider at 362396096
2021-06-30  5:12:04 376235117 [Note] WSREP: Provider resumed.
2021-06-30  5:12:04 0 [Note] WSREP: Member 0.0 (node1) resyncs itself to group.
2021-06-30  5:12:04 0 [Note] WSREP: Shifting DONOR/DESYNCED -> JOINED (TO: 738363159)
2021-06-30  5:12:04 0 [Note] WSREP: Member 0.0 (node1) synced with group.
2021-06-30  5:12:04 0 [Note] WSREP: Shifting JOINED -> SYNCED (TO: 738363159)
2021-06-30  5:12:04 27 [Note] WSREP: Synchronized with group, ready for connections

Table Definition :-

 
CREATE TABLE `<table_name>` (
  `col1` int(10) unsigned NOT NULL DEFAULT 0 COMMENT 'ABC',
  `col2` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT 'XYZ',
  `col3` int(10) unsigned DEFAULT NULL COMMENT 'ABC_XYZ',
  PRIMARY KEY (`col1`,`col2`),
  KEY `col3` (`col3`),
  CONSTRAINT `key1` FOREIGN KEY (`col1`) REFERENCES `events` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `key2` FOREIGN KEY (`col3`) REFERENCES `events` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC

Configuration wise , all looks normal except added transaction_isolation is REPEATABLE-READ



 Comments   
Comment by Jan Lindström (Inactive) [ 2021-07-02 ]

https://github.com/MariaDB/server/commit/dd64f0830768269807bd039bbad661f9797d3bfc

Comment by Marko Mäkelä [ 2021-07-20 ]

Note that MDEV-22721 introduced ib::logger::operator<<(dberr_t err). In several places, your suggested change is replacing textual error messages with internal numeric error codes, which may differ even between minor versions. Please use explicit ut_strerr(err) when invoking printf-style functions.

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