[PDB-2486] PuppetDB crashes during startup migration with namespaced trgm indices Created: 2016/03/01 Updated: 2016/04/04 Resolved: 2016/03/14
|Affects Version/s:||PDB 2.3.8|
|Fix Version/s:||PDB 3.2.5, PDB 4.0.0|
|Remaining Estimate:||Not Specified|
|Time Spent:||Not Specified|
|Original Estimate:||Not Specified|
PuppetDB 2.3.8-1puppetlabs1 on Ubuntu 14.04
Our PuppetDB instance runs against a managed PostgreSQL service hosting multiple databases. This means that indices end up being created under the 'puppetdb' namespace rather than the 'public' one.
With pg_trgm indices enabled, PuppetDB crashes at startup as it tries to create duplicate indices during the migration operation. This is because it ends up looking in the 'public' namespace by default.
In storage-utils, the default namespace for testing whether an index exists is 'public', which is not necessarily correct for a given deployment.
The result is a BatchUpdateException, which kills the PuppetDB application straight away.
|Comment by Russell Mull [ 2016/03/01 ]|
Hi Nick Moriarty,
Can you tell us a more about your PostgreSQL setup? How are you getting PuppetDB to run outside the 'public' schema? Did you (or whoever is running the DB) set search_path for your user to '$user,public' or something similar?
|Comment by Nick Moriarty [ 2016/03/02 ]|
I asked for the information from our DBA - here's the reply:
|Comment by Wyatt Alt [ 2016/03/14 ]|
Nick Moriarty Thanks for the report. There's a fix destined for the 3.2.5 release – not sure about timing on that yet. Unfortunately though we are not actively developing the 2.3.x branch anymore, so that fix won't help you until you upgrade to 3.x.
If upgrading isn't feasible I think you could squeeze by by getting indexes named fact_paths_path_trgm and fact_values_string_trgm into the public schema somewhere, but that's such an ugly hack I'm almost embarrassed to mention it. Let us know if there's anything additional we can help with.