Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add definition of anyarray_uniq function to helpers sql #422

Closed
wants to merge 2 commits into from

Conversation

sraby
Copy link
Member

@sraby sraby commented Dec 3, 2020

So, it turns out that this function anyarray_uniq is NOT a pre-loaded array function that we get for free through the pg_catalog. This morning, we started seeing this critical error:

function anyarray_uniq(integer[]) does not exist LINE 8: unnest(anyarray_uniq(array_cat_agg(merged.uniqregids... ^ HINT: No function matches the given name and argument types...

and it turns out that anyarray_uniq was no longer defined. Given that this function lies within the definition of other vital functions that power key WOW interactions, like get_assoc_addrs_from_bbl, our search function.

Since anyarray_uniq does not get created through any script that powers our auto-updating instance of nycdb, I suspect that somehow this function got deleted during our rebuild and there was no code to recreate it.

So, this PR adds a function definition to our helpers.sql file to explicitly build anyarray_uniq whenever we rebuild the db. It also reorders our code a bit to make sure every function declaration runs in the proper order.

@sraby sraby requested a review from toolness December 3, 2020 15:55
@toolness
Copy link
Contributor

toolness commented Dec 3, 2020

Hmm, so I don't believe that adding this function in WoW is the answer... the explosion last night actually occurred because the auto-update of the hpd_registrations dataset failed, which left our nycdb instance in an inconsistent state. See this issue for more details: JustFixNYC/nycdb-k8s-loader#60

I'm going to close this PR because I feel pretty strongly that copying hpd_registrations's functions over to WoW isn't the right solution to this problem--the problem is that some of hpd_registrations's functions are being deleted by our auto-updating nycdb and not being restored, so we need to fix that. 😣

@toolness toolness closed this Dec 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants