Hi everyone, I am running into an issue with Redshift and would appreciate any suggestions.
I am creating some views on redshift using dbt. One of the in particular controls the row level access per user, so all models are ultimately joined with it. But it still is just a view definition, there are no tables in the mix.
Every single time dbt tries to update this view, if there are any queries at that time that involve that view (which is often, since this is a client facing database), it deadlocks.
By that I mean - dbt is not able to re-create the view, no one is able to query it, and this situations persists until dbt’s process is manually killed.
It seems to me that even if the view is under use, as long as there are a few seconds of downtime (which there are), then dbt should do its job and no deadlock should occur.
What I’ve tried so far:
- decreasing number of threads to 1
- running during a time when there is no more DB activity (this works without a problem)
Any ideas? It’s driving me crazy!
Thanks