Bib and authority record processing in Evergreen is handled by database triggers that fire whenever a record is inserted, updated, or deleted. This makes sure that processes such as catalog search and record display always have correct and up to date data. However, there are situations when the amount of processing time required to process, in particular, a large set of records is detrimental not only to staff, but can cause an action to time out entirely and fail processing.
Queued Ingest is meant to address this by allowing the system to remove time-intensive record processing from the core business logic workflow, and have that work be done in the background (nearly immediately, and in parallel where possible) without blocking staff work.
The in-database ingest logic has been refactored to add checks that decide when and how much processing should happen in-line, and alternatively, when to record the request for particular record ingest actions for later processing. Upon successful processing request queuing, the triggers will signal via Postgres' NOTIFY feature that there are now queued requests.
These decisions are made based on the state of a set of Global Flags, as well as a real-time, live overriding mechanism that can be used to impact specific ingest events, so that the system, or an administrator, can disable Queued Ingest in specific circumstances without having to change the state of the Global Flags for that one need.
The queued requests are handled by an external script that connects to the database, checks for overdue outstanding requests to process, and then waits to receive a notification, via Postgres' LISTEN feature, that one or more processing requests have been enqueued. Upon receiving notification, this script will gather outstanding requests and process them, optionally in parallel.
This script also provides a command line interface for creating named and staff-owned queues, adding processing requests (either to named/owned queues, for tracking purposes, or to the main anonymous request queue), and investigating the current and historical processing status of queued requests.
A branch implementing Queued ingest is available at:
https:/ /git.evergreen- ils.org/ ?p=working/ Evergreen. git;a=shortlog; h=refs/ heads/user/ miker/lp- 1979071- queued- ingest
NOTE: The baseline schema has intentionally /not/ been reified with the changes from the DB upgrade script yet. To test, you will still need to run the DB upgrade (Open-ILS/ src/sql/ Pg/upgrade/ XXXX.schema. queued_ ingest. sql) after a fresh installation. Likewise, you can test this in a existing (relatively recent) installation by just running that upgrade script. Reification is left out at the moment because there are at least two other commits that may make it into master before Queued Ingest, and delaying baseline update will remove one potential source of bugs that could sneak in during merge cleanup.