[Bug 37775] New: update_totalissues.pl uses $dbh->commit but does not use transactions
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37775 Bug ID: 37775 Summary: update_totalissues.pl uses $dbh->commit but does not use transactions Change sponsored?: --- Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: major Priority: P5 - low Component: Command-line Utilities Assignee: koha-bugs@lists.koha-community.org Reporter: nick@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org CC: robin@catalyst.net.nz The script disables AutoCommit and calls commit on the dbh directly. As this dbh is shared I believe it closes all current transactions. We have seen in the logs a warning when the cron is running during library operating hours: DBIx::Class::Storage::DBI::mysql::_exec_svp_release(): DBI Exception: DBD::mysql::db do failed: SAVEPOINT savepoint_3 does not exist at /usr/share/koha/lib/Koha/Object.pm line 170 I believe if we resolve bug 36474, effectively reducing the scope fo the job from "all records in the DB" to "only updated records" - we can remove the need for delayed commits here. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37775 Nick Clemens (kidclamp) <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |36474 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36474 [Bug 36474] updatetotalissues.pl should not modify the record when the total issues has not changed -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37775 Nick Clemens (kidclamp) <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37775 --- Comment #1 from Nick Clemens (kidclamp) <nick@bywatersolutions.com> --- Created attachment 170908 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=170908&action=edit Bug 37775: Remove delayed commits from update_totalissues.pl and add progress option This patch removes setting AutoCommit to 0 and commiting only every X records. Instead we commit as we go and report progress using a parameter. Bug 36474 reduced the numebr of changes that are being committed, so this should be a reasonable change. The use of commits without transactions was causing problems if the library was active while the script ran. To test: 1 - perl misc/cronjobs/update_totalissues.pl -c 2 - Script runs, but with unknown parameter 3 - perl misc/cronjobs/update_totalissues.pl -p 10 4 - Script runs and reports every 10 records 5 - per; misc/cronjobs/update_totalissues.pl 6 - Script runs and reports every 100 records by default -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37775 --- Comment #2 from Nick Clemens (kidclamp) <nick@bywatersolutions.com> --- Created attachment 170909 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=170909&action=edit Bug 37775: Spelling and tidy -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37775 Nick Clemens (kidclamp) <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |nick@bywatersolutions.com |ity.org | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37775 Brendan Lawlor <blawlor@clamsnet.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37775 Brendan Lawlor <blawlor@clamsnet.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #170908|0 |1 is obsolete| | --- Comment #3 from Brendan Lawlor <blawlor@clamsnet.org> --- Created attachment 171490 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=171490&action=edit Bug 37775: Remove delayed commits from update_totalissues.pl and add progress option This patch removes setting AutoCommit to 0 and commiting only every X records. Instead we commit as we go and report progress using a parameter. Bug 36474 reduced the numebr of changes that are being committed, so this should be a reasonable change. The use of commits without transactions was causing problems if the library was active while the script ran. To test: 1 - perl misc/cronjobs/update_totalissues.pl -c 2 - Script runs, but with unknown parameter 3 - perl misc/cronjobs/update_totalissues.pl -p 10 4 - Script runs and reports every 10 records 5 - per; misc/cronjobs/update_totalissues.pl 6 - Script runs and reports every 100 records by default Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37775 Brendan Lawlor <blawlor@clamsnet.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #170909|0 |1 is obsolete| | --- Comment #4 from Brendan Lawlor <blawlor@clamsnet.org> --- Created attachment 171491 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=171491&action=edit Bug 37775: Spelling and tidy Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37775 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #171490|0 |1 is obsolete| | --- Comment #5 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 171648 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=171648&action=edit Bug 37775: Remove delayed commits from update_totalissues.pl and add progress option This patch removes setting AutoCommit to 0 and commiting only every X records. Instead we commit as we go and report progress using a parameter. Bug 36474 reduced the numebr of changes that are being committed, so this should be a reasonable change. The use of commits without transactions was causing problems if the library was active while the script ran. To test: 1 - perl misc/cronjobs/update_totalissues.pl -c 2 - Script runs, but with unknown parameter 3 - perl misc/cronjobs/update_totalissues.pl -p 10 4 - Script runs and reports every 10 records 5 - per; misc/cronjobs/update_totalissues.pl 6 - Script runs and reports every 100 records by default Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37775 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #171491|0 |1 is obsolete| | --- Comment #6 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 171649 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=171649&action=edit Bug 37775: Spelling and tidy Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37775 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com Status|Signed Off |Passed QA QA Contact|testopia@bugs.koha-communit |martin.renvoize@ptfs-europe |y.org |.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37775 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to main Version(s)| |24.11.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37775 --- Comment #7 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Thanks for all the hard work! Pushed to main for the next 24.11.00 release as RM Assistant -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37775 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to main |Pushed to stable CC| |lucas@bywatersolutions.com Version(s)|24.11.00 |24.11.00,24.05.04 released in| | --- Comment #8 from Lucas Gass <lucas@bywatersolutions.com> --- Backported to 24.05.x for upcoming 24.05.04 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37775 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|24.11.00,24.05.04 |24.11.00,24.05.04,23.11.10 released in| | Status|Pushed to stable |Pushed to oldstable CC| |fridolin.somers@biblibre.co | |m --- Comment #9 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 23.11.x for 23.11.10 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37775 Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |wainuiwitikapark@catalyst.n | |et.nz --- Comment #10 from Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> --- Not backporting to 23.05.x unless requested -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37775 Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to oldstable |RESOLVED Resolution|--- |FIXED --- Comment #11 from Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> --- Not backporting to 22.11 unless requested -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37775 Bug 37775 depends on bug 36474, which changed state. Bug 36474 Summary: updatetotalissues.pl should not modify the record when the total issues has not changed https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36474 What |Removed |Added ---------------------------------------------------------------------------- Status|Needs documenting |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org