Hold rule mismatches from too much weight applied to requestor.grp
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Evergreen |
Fix Released
|
Medium
|
Unassigned | ||
2.1 |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
EG Version: 1.6.0.2
OpenSRF Version: 1.2.2
PostgreSQL Version: 8.3
Linux distribution: Debian
When we went live with our first development partner libraries back in March 2010, we noticed that there was a major problem with the way that holds were being matched against the rules set in the config.
Working with Galen Charlton from ESI, we tracked the potential source of the problem to something in how the holds matching logic applied with regards to the requestor.grp field in the hold matrix. As explained to us, the problem was often that once a hold request matched to a particular requesting user group's hold rule, it would fail to recognize a more specific rule that should have matched better elsewhere in the table. Too much weight was being applied to the requestor.grp and that was messing up all our hold placements.
Currently, we have an adjusted hold matrix matching logic that skips matches to the requestor.grp as a temporary measure, but would like to find a better solution with the community. A big question we have is how the current holds logic is applied to finding matchpoints and what weights are assigned to particular fields.
Will try to supply additional information as best I can.
description: | updated |
Changed in evergreen: | |
status: | New → Triaged |
importance: | Undecided → Medium |
Changed in evergreen: | |
status: | In Progress → Fix Released |
In trunk and in rel_1_6_0, the action. find_hold_ matrix_ matchpoint loops first over the requestor object's permission group and ancestors and for each group queries the config. hold_matrix_ matchpoint for a match. This looping stops when the requestor runs out of ancestor permission groups or when a matchpoint is found as demonstrated by the following code on line 158 for 110.hold_ matrix. sql:
EXIT WHEN current_ requestor_ group.parent IS NULL OR matchpoint.id IS NOT NULL;
This means that any matchpoints applying specifically to the requestor's group will take precedence over any matchpoints that apply to broader permission groups.
This means that you will need to use caution when setting the requestor_grp field in config. hold_matrix_ matchpoint, and possibly duplicate any matchpoints applied to ancestor permission groups to ensure that the proper rule is always used.
My suggestion would be to not use the requestor_grp field, setting it always to 1, so that it matches for all users if you can.
Another option might be to remove the OR matchpoint.id IS NOT NULL on line 158. This would cause the function to loop over all matchpoints for the user's group and ancestor groups and then use the matchpoint with the lowest weight score.