Files
windmill/backend/migrations/20261105210250_queue_priority_without_null.up.sql
T
Ruben FiszelandClaude Opus 5.5 3c5a5caf97 feat: inherited low priority for background flows and scripts (#12256)
* feat: add inherited low priority for background flows and scripts

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: keep a low flow priority over step priorities and align the -1 boundary

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs: note the rolling-upgrade ordering and the renamed queue index

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* refactor: order low priority by stored values instead of a coalesce index

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: keep a runnable's own priority when its caller has none

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: do not pass a flow step's default priority on to the jobs it starts

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 23:26:04 +01:00

8 lines
451 B
SQL

-- Workers pull `ORDER BY priority DESC NULLS LAST`. A job without priority is pushed as 0 and
-- flow steps and dependency jobs as 1, so that a negative (low) priority sorts after the
-- former. Moves the jobs already queued to those values so they keep their place; a NULL left
-- behind would sort after every low-priority job.
UPDATE v2_job_queue
SET priority = CASE WHEN priority IS NULL THEN 0 ELSE 1 END
WHERE priority IS NULL OR priority = 0;