Bugzilla – Attachment 117373 Details for
Bug 26457
DB DeadLock when renewing checkout items
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26457: (QA follow-up) Switch to PK index in UPDATE on issues
Bug-26457-QA-follow-up-Switch-to-PK-index-in-UPDAT.patch (text/plain), 1.82 KB, created by
Marcel de Rooy
on 2021-02-26 10:54:15 UTC
(
hide
)
Description:
Bug 26457: (QA follow-up) Switch to PK index in UPDATE on issues
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2021-02-26 10:54:15 UTC
Size:
1.82 KB
patch
obsolete
>From 3f4f17b8583b87cccc8551227f784d074ed2000a Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Fri, 26 Feb 2021 10:26:27 +0000 >Subject: [PATCH] Bug 26457: (QA follow-up) Switch to PK index in UPDATE on > issues >Content-Type: text/plain; charset=utf-8 > >The deadlock reports tell us that multiple transactions are >waiting for a X lock on a record but using a secondary index >on borrowernumber and itemnumber. Since we have the issue_id >at hand already, we should use that and benefit from the clustered >index (on PK) instead of using a secondary index. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > C4/Circulation.pm | 7 ++----- > 1 file changed, 2 insertions(+), 5 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 021d80a65e..24bed92278 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -3034,13 +3034,10 @@ sub AddRenewal { > # Update the issues record to have the new due date, and a new count > # of how many times it has been renewed. > my $renews = ( $issue->renewals || 0 ) + 1; >- my $sth = $dbh->prepare("UPDATE issues SET date_due = ?, renewals = ?, unseen_renewals = ?, lastreneweddate = ? >- WHERE borrowernumber=? >- AND itemnumber=?" >- ); >+ my $sth = $dbh->prepare("UPDATE issues SET date_due = ?, renewals = ?, unseen_renewals = ?, lastreneweddate = ? WHERE issue_id = ?"); > > eval{ >- $sth->execute( $datedue->strftime('%Y-%m-%d %H:%M'), $renews, $unseen_renewals, $lastreneweddate, $borrowernumber, $itemnumber ); >+ $sth->execute( $datedue->strftime('%Y-%m-%d %H:%M'), $renews, $unseen_renewals, $lastreneweddate, $issue->issue_id ); > }; > if( $sth->err ){ > Koha::Exceptions::Checkout::FailedRenewal->throw( >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 26457
:
114184
|
114185
|
114186
|
114187
|
114190
|
114669
|
114697
|
117227
|
117228
|
117371
|
117372
| 117373 |
117876
|
118647