[Koha-bugs] [Bug 29483] AllowRenewalIfOtherItemsAvailable has poor performance for records with many items

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri May 6 13:34:58 CEST 2022


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29483

--- Comment #31 from Nick Clemens <nick at bywatersolutions.com> ---
Created attachment 134723
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=134723&action=edit
Bug 29483: [21.11.x] Check ItemsAnyAvailableAndNotRestricted once per patron

ItemsAnyAvailableAndNotRestricted can take a long time and create nested loops.
We can check it once per patron, however, this requires us to flip the loops.
Since an item can only be used once, we now add a check to see if this item has
already
been assigned to a borrower.

To test:
1 - Find or create a biblio with 100 items
2 - Place ten 'Next available' holds on a biblio
3 - Set preference 'AllowRenewalIfOtherItemsAvailable' to 'Allow'
    Set circ rules 'On shelf holds allowed' to 'If any unavailable'
4 - Checkout one of the items to a patron, backdated to be overdue
5 - Note a long loading time for the patron's checkouts
6 - Apply patch, restart_all
7 - Patron loads much faster

Signed-off-by: Andrew Fuerste-Henry <andrew at bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize at ptfs-europe.com>

Bug 29483: Unit tests

This patch updates the AllowRenewalIfOtherItemsAvailable tests to
remove deletion of all data, and create specific circ rules for this
test. It adjust several other tests that were relying on the rules from
this test, so thy too create their opwn specific rules.

Additionally, we add tests to cover the case of mutliple items on the record,
and some items cannot fill some reserves.

What is uncovered here is that the same patron is checked twice, so two holds
can
be filled, but they only satisfy a single patron

Signed-off-by: Andrew Fuerste-Henry <andrew at bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize at ptfs-europe.com>

Bug 29483: Further improve performance of script

This patch adds a few tests to cover more cases, and to highlight current
functionality.

The script only allows renewal if all outstanding holds can be filled by
available items.
This means we can return as soon as we have determined that not all holds can
be filled.

I add FIXME and some explanatory comments - I will file a follow-up bug for
those, but
I feel we can accept these improvements to the performance and deal with the
issues
of how it 'should' work versus how it does work on another report.

To test:
1 - prove -v t/db_dependent/Circulation.t

Signed-off-by: Andrew Fuerste-Henry <andrew at bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize at ptfs-europe.com>

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list