Last tested: Mar 12, 2021
WLM is a Redshift tool that assigns different queries to different queues to distribute load.
Looker does not support using WLM with PDTs.
We can also see this with those using Aptible database tunnels.
WLM cancels build statements when they’re moved from one queue to another, which means PDTs essentially get killed and restarted on the DB, but Looker thinks they’re killed so it starts another one. Chaos ensues.
Specifically, here is what can happen:
- Looker starts a PDT.
- WLM kills PDT.
- WLM restarts PDT.
- Looker starts a second PDT that is actually the same.
- WLM PDT finishes.
- Looker PDT finishes and errors out because WLM PDT already exists.
- Looker thinks the PDT build failed and returns you an error in the UI.
Why do queries switch queues?
Most Redshift clusters have WLM enabled with 1 queue. When there is more than 1 queue, queries that come in to the database are assigned to their appropriate queue. When the query gets assigned to the appropriate queue, it is given a new pid and the previous pid appears as cancelled.