Redshift view deadlocks?

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

I am also experiencing this issue in Redshift. It is occurring for a view on a pretty simple and small table and the error occurrences include early morning schedules when there should be no activity on that table.

It is intermittent though. Not all scheduled runs have the issue.

I would love others thoughts on this.

@hags setting the late binding property for the views appears to have helped, but I don’t really understand why

You’re right that setting the bind: false config is the way to solve this - it changes the views to be “late binding”.

Here’s an explanation of what late-binding views are, and why they are helpful:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.