Checkins for age protected items on Bib Records with many holds can take a long time

Bug #1803768 reported by Michele Morgan
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Evergreen
Confirmed
Medium
Unassigned

Bug Description

Here are a couple of use cases:

Use case 1:

My item attached to a new bestseller is under age-based hold protection. The bib record has 75 holds, but none for pickup at my library. When I check in the item it takes six seconds for the checkin to process. The item goes to Reshelving status.

Use case 2:

My rental item attached to a new bestseller has the holdable flag set to FALSE. The bib record has 75 holds. When I check the item in, it takes seven seconds for the checkin to process. The item goes to Reshelving status.

The library that reported this issue has come up with a name for these items as this occurs frequently: "slow barcodes".

System logs show that holds are being checked in succession to see if the copy can fill each one:

2018-11-14 11:48:37 brick0 open-ils.circ: [INFO:196158:Holds.pm:3151:1542213115195735107] circulator: checking if hold 3276811 is permitted for copy 31458004323799
2018-11-14 11:48:37 brick0 open-ils.circ: [INFO:196158:Holds.pm:3151:1542213115195735107] circulator: checking if hold 3276812 is permitted for copy 31458004323799
2018-11-14 11:48:37 brick0 open-ils.circ: [INFO:196158:Holds.pm:3151:1542213115195735107] circulator: checking if hold 3276813 is permitted for copy 31458004323799
2018-11-14 11:48:37 brick0 open-ils.circ: [INFO:196158:Holds.pm:3151:1542213115195735107] circulator: checking if hold 3276814 is permitted for copy 31458004323799
2018-11-14 11:48:37 brick0 open-ils.circ: [INFO:196158:Holds.pm:3151:1542213115195735107] circulator: checking if hold 3279445 is permitted for copy 31458004323799
2018-11-14 11:48:37 brick0 open-ils.circ: [INFO:196158:Holds.pm:3151:1542213115195735107] circulator: checking if hold 3282253 is permitted for copy 31458004323799
2018-11-14 11:48:37 brick0 open-ils.circ: [INFO:196158:Holds.pm:3151:1542213115195735107] circulator: checking if hold 3283152 is permitted for copy 31458004323799

Many seconds pass as the holds are checked. This makes sense in general, but isn't efficient for age hold protected items that can only fill a subset of the total holds on the record, and less so for items where the holdable flag is set to FALSE.

While it's true that type F and R holds will still apply to these items, it doesn't really make sense to check every hold on the off chance that there may be a F or R type hold that would apply. Prefiltering the holds to be checked and/or handling special case hold types (like F and R) and special case items (like age protected and not holdable) differently would greatly improve efficiency at checkin.

I'm also adding a link to a related bug that points out that the limit on the number of holds checked is 100, so holds applicable to the item can be missed:

https://bugs.launchpad.net/evergreen/+bug/1508208

Tags: checkin holds
Revision history for this message
Josh Stompro (u-launchpad-stompro-org) wrote :

One simple way to pre-filter would be to hook into the best hold selection sort.

To keep non R and F holds from being evaluated for non holdable copies, something like this could be done.

And the following to the best hold selection sort query - http://git.evergreen-ils.org/?p=Evergreen.git;a=blob;f=Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm#l581

AND (h.hold_type IN ('R','F') or exists (select 1 from asset.copy acp where acp.id=hm.target_copy and acp.holdable) )

That would result in only Recall and Force holds being included when a copy isn't holdable because of the asset.copy holdable field.

The performance impact of that addition seems to be minor when I try it out, but I think that would take care of the above issue with a rental item that isn't holdable.

This wouldn't help if an item isn't holdable because of shelving location, but that could also be added. I wouldn't think that status would apply in this instance, since this isn't for targeting.

An age hold protection filter can probably also be added this way, but that has more variables to pull in.

I don't know if this is really a good solution though, since it moves permit hold logic into the nearest hold section. It may make things less understandable in the future.

Josh

Revision history for this message
Blake GH (bmagic) wrote :

related:

bug 1508208

Revision history for this message
Josh Stompro (u-launchpad-stompro-org) wrote :

I see why this is a hard problem. The age hold protection determination depends on the hold matrix matchpoint to know if the owning lib or the circ lib is used to pull the active date use setting and to choose where to measure the distance from. Maybe we could just look at all the variations and include the hold if any of them are true? There would still be a chance that holds would be included that will fail the hold permit test later, but I cannot picture a situation where the owning lib and circ lib would be different where they would be in different age hold protection scopes.

Revision history for this message
Michele Morgan (mmorgan) wrote :

Description edited to remove the part about non-holdable items. Turns out that if targeting is up to date, non-holdable items will not exhibit the checkin delay because there will be no entries for the item in the hold_copy_map.

That said, age protected items are still a problem. A recent IRC discussion raised the question of whether items under age based hold protection should have entries in the hold copy map for holds that they cannot fill until their age hold protection expires. That approach seems like it should resolve this issue, as well as bug 1508208.

Here's a link to that IRC discussion:

http://irc.evergreen-ils.org/evergreen/2019-03-28#i_400725

Is there any benefit to having rows in the hold_copy_map that map age protected items to holds that they cannot fill?

summary: - Checkins for not holdable or age protected items on Bib Records with
- many holds can take a long time
+ Checkins for age protected items on Bib Records with many holds can take
+ a long time
Revision history for this message
Dawn Dale (ddale) wrote :

I have had many reports of delayed checkin of items with long list of holds. The process of seeing if the item is on hold takes longer than it should. This causes problems when staff are checking in a stack of items. They continue scanning and don't realize the system is still working on the item with a hold. I know they should watch the screen to be sure the process has finished but they don't. We have categorized this as staff training for the most part but if the timing could be faster it would be wonderful. Confirming this behavior.

Dawn Dale (ddale)
Changed in evergreen:
status: New → Confirmed
Revision history for this message
Mike Rylander (mrylander) wrote :

FWIW, I've updated my branch proposing to fix bug 1508208, and I agree with Michele that it would address both that one and this -- I think they're the same bug.

Revision history for this message
Andrea Neiman (aneiman) wrote :

Based on Michele's and Mike's comments I'm marking this a duplicate of bug 1508208

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.