]> git.evergreen-ils.org Git - Evergreen.git/commit
LP#1596595 Hold targeter refactoring and optimization.
authorBill Erickson <berickxx@gmail.com>
Tue, 7 Jun 2016 21:32:14 +0000 (17:32 -0400)
committerKathy Lussier <klussier@masslnc.org>
Fri, 17 Feb 2017 05:58:53 +0000 (00:58 -0500)
commit75625c2f8866b3890c76defa4f7d9e74182b2fdd
tree3b19caaee64defc0e37f916e67e0df004c375200
parent922b4b317cabda8ce9c87902be4f8b53555c84db
LP#1596595 Hold targeter refactoring and optimization.

* New open-ils.hold-targeter service

* Ports hold targeter code to a Perl utility function, communicating w/
  the DB via cstore instead of storage.

* Adds a new global flag 'circ.holds.retarget_interval' for configuring
  the hold retarget interval in the database.

* Adds a new DB function to regenerating hold copy maps to make map
  deletion and creation more efficient.

* Adds an option for targeting holds in newest to oldest order.

* Caches all org unit settings per targeter run.

* Adds support for "skip_viable" option.  This tells the hold targeter
  to avoid modifying any holds that target viable copies.  AKA "fix
  broken" mode.

  For example, you might run in skip_viable mode with a retarget
  interval of 24hr once a day to repair non-viable holds, then also run
  the targeter in regular mode once a day with a retarget interval of 48
  hours to give staff 2 days to process viable holds.

* Hold target loops logic changes:

 ** Org units with fewer target attempts are prioritized during loop
    processing.  So, instead of segregating org units into 2 categetories,
    those attempted in the current loop and those not attempted, sort those
    not attempted by the number number of times they have been attempted.
    Within each grouping, prioritize by target weight/proximity as before.

 ** All org units that have been attempted less than the max configured
    amount are on the table for targeting, not just those that have been
    targeted less than the current loop max.  If no orgs with
    less-than-current-max attempts are found, try orgs that match the
    current max (but are still less than the configured max).

 ** When activated, target looping treats the pickup lib like any
    other org unit.  If a targeted copy at the pickup lib remains
    un-captured, at re-target time, a copy at a different branch is
    chosen (if one is available) even if other copies at the pickup
    lib are targetable.

* Parallel targeting support baked into service.

  Teach the targeter to process a subset of holds based on the number of
  parallel targeters at play and the parallel targeting slot each targeter
  instance occupies.

  As with the existing hold targeter, group holds by their metarecord to
  avoid multiple targeter processes targeting the same sets of potential
  copies.

* Logging / code refactoring and clean up.

* New hold_targeter_v2.pl script for batch hold targeting.  Existing
  targeter remains for backwards-compat.

hold_targeter_v2.pl options:

--verbose
    Print process counts

--parallel <parallel-process-count>
    Number of parallel hold processors to run.  This overrides any
    value found in opensrf.xml

--target-all
    Target all active holds, regardless of when they were last targeted.

--skip-viable
    Avoid modifying holds that currently target viable copies.
    In other words, only (re)target holds in a non-viable state.

--retarget-interval
    Override the 'circ.holds.retarget_interval' global_flag value.

--parallel-init-sleep
    Time to wait between starting each parallel instance.  Useful for
    avoiding dog-piling the DB.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Chris Sharp <csharp@georgialibraries.org>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Open-ILS/examples/opensrf.xml.example
Open-ILS/src/Makefile.am
Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm
Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm
Open-ILS/src/perlmods/lib/OpenILS/Application/HoldTargeter.pm [new file with mode: 0644]
Open-ILS/src/perlmods/lib/OpenILS/Utils/HoldTargeter.pm [new file with mode: 0644]
Open-ILS/src/sql/Pg/090.schema.action.sql
Open-ILS/src/sql/Pg/950.data.seed-values.sql
Open-ILS/src/sql/Pg/upgrade/XXXX.schema.hold_targeter.sql [new file with mode: 0644]
Open-ILS/src/support-scripts/hold_targeter_v2.pl [new file with mode: 0755]