[Bug 26596] New: koha-upgrade-schema should check version before calling updatedatabase.pl
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26596 Bug ID: 26596 Summary: koha-upgrade-schema should check version before calling updatedatabase.pl Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: dcook@prosentient.com.au QA Contact: testopia@bugs.koha-community.org At the moment, koha-upgrade-schema indiscriminately runs updatedatabase.pl, regardless of whether or not the Koha instance actually requires a database upgrade. I've noted that running koha-upgrade-schema against a large number of instances (e.g. 50 instances) takes a couple of minutes. Jonathan has noted doing an upgrade will take 1.5 seconds, so 1.5 x 50 = would be 1.25 minutes. Jonathan and I agreed via email that koha-upgrade-schema should do a check similar to C4::Auth::_version_check but without using the ORM via C4::Context->preference() to avoid the overhead of loading the DBIC schema. In theory, koha-upgrade-schema should be able to spin through 50 instances in a fraction of a second, if none of them need database upgrades. -- 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=26596 --- Comment #1 from David Cook <dcook@prosentient.com.au> --- This isn't an urgent matter for me, so I'm not going to mark myself as the Assignee, but I may get to this at some point. -- 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=26596 --- Comment #2 from David Cook <dcook@prosentient.com.au> --- I'm noticing that updatedatabase.pl uses 100% CPU and runs for a while, so this is just annoying me too much now. Rather than make the change to koha-upgrade-schema though, I'm going to change updatedatabase.pl. -- 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=26596 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|koha-upgrade-schema should |updatedatabase.pl uses too |check version before |much CPU when it has 0 |calling updatedatabase.pl |updates to run -- 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=26596 --- Comment #3 from David Cook <dcook@prosentient.com.au> --- All we need to do is the following at the top of updatedatabase.pl: my $original_version = C4::Context->preference("Version"); my $code_version = $Koha::VERSION; if ( $original_version >= TransformToNum($code_version){ exit 0; } -- If the code version is the same or higher than the current database version, then there cannot possibly be any database updates to run, and we should exit immediately, rather than consuming 100% CPU for way too long by doing 23,000 lines of updates. This is a short-term solution as overhauling the database update system is the long-term solution. -- 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=26596 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |DUPLICATE Status|NEW |RESOLVED --- Comment #4 from David Cook <dcook@prosentient.com.au> --- *** This bug has been marked as a duplicate of bug 34088 *** -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org