Set search_path when doing "SET ROLE" for shared pool connection
Description
CSP Request Details
None
CSP Rejection Details
None
Potential Workaround
None
blocks
relates to
Checklist
hideTestRail: Results
Activity
Show:
Marc Johnson December 7, 2022 at 12:11 PM
As this affects all modules using RMB, at what point do we advocate that all RMB based modules should be upgraded and back ported releases made?
Julian Ladisch December 7, 2022 at 6:49 AM
Backport for Morning Glory released as v34.0.3 just in case we need it for priority P1 issue .
Julian Ladisch December 6, 2022 at 8:39 PM
No backport because workaround exists.
Done
Details
Details
Assignee
Julian Ladisch
Julian LadischReporter
Julian Ladisch
Julian LadischLabels
Priority
Story Points
5
Sprint
None
Development Team
Core: Platform
Release
Nolana (R3 2022) Bug Fix
RCA Group
Implementation coding issue
TestRail: Cases
Open TestRail: Cases
TestRail: Runs
Open TestRail: Runs
Created November 21, 2022 at 8:59 AM
Updated May 22, 2024 at 11:53 AM
Resolved November 21, 2022 at 3:07 PM
TestRail: Cases
TestRail: Runs
Steps to Reproduce:
Set environment variable DB_MAXSHAREDPOOLSIZE=4
Set other environment variables as needed (PostgreSQL and Kafka)
Start mod-inventory-storage-25.0.1: java -jar target/mod-inventory-storage-fat.jar
Enable it for tenant diku with reference data using POST http://localhost:8081/_/tenant
Enable it for tenant t2 with reference data using POST http://localhost:8081/_/tenant
Disable it with purge option for tenant t2 using POST http://localhost:8081/_/tenant
For tenant diku call GET /instance-formats?query=cql.allRecords=1%20sortby%20name
Expected Results:
GET succeeds
Actual Results:
GET fails:
Additional Information:
PostgresClient calls "SET ROLE" but doesn't call "SET SCHEMA":
https://github.com/folio-org/raml-module-builder/blob/v35.0.0/domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java#L3497-L3516
"SET SCHEMA" is needed to set the search path.
When enabling tenant t2 reference data is loaded for schema t2_mod_inventory_storage using database connections that are kept open in idle state and re-used for the GET request.
Workaround:
After disabling/purging a tenant restart all (at least all RMB based) containers/pods.