Failure to update/write in a [read only] replica reporting environment

Bug #1586695 reported by Brent Mills
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Evergreen Quick Reports
New
Undecided
Unassigned

Bug Description

When Quick Reports is looking for the database credentials to connect in opensrf.xml it looks at the <database> stanza to get its connection info (host, port, dbname, user, password).

This is fine unless your opensrf.xml has different <database> and <state_store> entries. This can often be the case in read-only replica environments (Postgres streaming) where the <state_store> information points to the production database for write/updates and relies on the <database> information to run the SELECT queries for the reports.

Not relying on opensrf.xml and passing the QR_PGSQL_HOST/PORTDBNAME, etc.. options in production.config.ph is an option, and you can also change the <database> sections in openilsConfig.class.php to point to the <state_store> bits so that writes will always succeed.

openilsConfig.class.php (current)
[snip]
$xml->default->reporter->setup->database->host);
...
...

openilsConfig.class.php (for state_store)
$xml->default->reporter->setup->state_store->host);
...
...

I'm not sure if this would fix the reasoning behind having replica databases for reporting -- to ensure rogue reports can't bring down the system and to shift reporting load of the main db.

Is there a way I'm missing to include the <state_store> production db info for tasks that require updates and otherwise rely on the <database> (replica) connection?

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.