https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26457 Bug ID: 26457 Summary: DB DeadLock when renewing checkout items Change sponsored?: --- Product: Koha Version: 19.11 Hardware: All OS: All Status: NEW Severity: major Priority: P5 - low Component: Circulation Assignee: koha-bugs@lists.koha-community.org Reporter: didier.gautheron@biblibre.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle.m.hall@gmail.com Hi, Since it's in a transaction ( https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20086 ) we are seeing deadlock when renewing checkout and items aren't renewed randomly. plack error DBD::mysql::st execute failed: Deadlock found when trying to get lock; try restarting transaction [for Statement "UPDATE issues SET date_due = ?, renewals = ?, lastreneweddate = ? WHERE borrowernumber=? AND itemnumber=?" with P SHOW ENGINE INNODB STATUS; ----------------------- LATEST DETECTED DEADLOCK ------------------------ 2020-09-14 11:09:55 0x7f69b85c0700 *** (1) TRANSACTION: TRANSACTION 19363996, ACTIVE 1 sec fetching rows mysql tables in use 4, locked 4 LOCK WAIT 7 lock struct(s), heap size 1128, 8 row lock(s) MySQL thread id 22449, OS thread handle 140092040718080, query id 38767706 localhost kohaadmin Updating UPDATE issues SET date_due = '2020-09-18 23:59', renewals = '1', lastreneweddate = '2020-09-14T11:09:54' WHERE borrowernumber='93697' AND itemnumber='999735' *** (1) WAITING FOR THIS LOCK TO BE GRANTED: RECORD LOCKS space id 476 page no 87 n bits 248 index PRIMARY of table `koha`.`issues` trx id 19363996 lock_mode X locks rec but not gap waiting Record lock, heap no 109 PHYSICAL RECORD: n_fields 18; compact format; info bits 0 0: len 4; hex 802713f6; asc ' ;; 1: len 6; hex 000000000000; asc ;; 2: len 7; hex 80000000000000; asc ;; 3: len 4; hex 80016e01; asc n ;; 4: len 4; hex 8008e784; asc ;; 5: len 5; hex 99a7397ec0; asc 9~ ;; 6: len 6; hex 43454e545245; asc CENTRE;; 7: SQL NULL; 8: SQL NULL; 9: len 1; hex 80; asc ;; 10: len 1; hex 80; asc ;; 11: SQL NULL; 12: len 4; hex 5f326b5e; asc _2k^;; 13: len 5; hex 99a6e20000; asc ;; 14: len 4; hex 80000000; asc ;; 15: SQL NULL; 16: SQL NULL; 17: SQL NULL; *** (2) TRANSACTION: TRANSACTION 19363999, ACTIVE 1 sec starting index read mysql tables in use 4, locked 4 4 lock struct(s), heap size 1128, 3 row lock(s) MySQL thread id 22450, OS thread handle 140092041332480, query id 38767702 localhost kohaadmin Updating UPDATE issues SET date_due = '2020-09-18 23:59', renewals = '1', lastreneweddate = '2020-09-14T11:09:54' WHERE borrowernumber='93697' AND itemnumber='583556' *** (2) HOLDS THE LOCK(S): RECORD LOCKS space id 476 page no 87 n bits 248 index PRIMARY of table `koha`.`issues` trx id 19363999 lock_mode X locks rec but not gap Record lock, heap no 109 PHYSICAL RECORD: n_fields 18; compact format; info bits 0 0: len 4; hex 802713f6; asc ' ;; 1: len 6; hex 000000000000; asc ;; 2: len 7; hex 80000000000000; asc ;; 3: len 4; hex 80016e01; asc n ;; 4: len 4; hex 8008e784; asc ;; 5: len 5; hex 99a7397ec0; asc 9~ ;; 6: len 6; hex 43454e545245; asc CENTRE;; 7: SQL NULL; 8: SQL NULL; 9: len 1; hex 80; asc ;; 10: len 1; hex 80; asc ;; 11: SQL NULL; 12: len 4; hex 5f326b5e; asc _2k^;; 13: len 5; hex 99a6e20000; asc ;; 14: len 4; hex 80000000; asc ;; 15: SQL NULL; 16: SQL NULL; 17: SQL NULL; *** (2) WAITING FOR THIS LOCK TO BE GRANTED: RECORD LOCKS space id 476 page no 425 n bits 1168 index issuesborridx of table `koha`.`issues` trx id 19363999 lock_mode X waiting Record lock, heap no 52 PHYSICAL RECORD: n_fields 2; compact format; info bits 0 0: len 4; hex 80016e01; asc n ;; 1: len 4; hex 8026df40; asc & @;; *** WE ROLL BACK TRANSACTION (2) -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.