Upgrading to v0.7#

This release introduces a rules-based Pro Pruner, chunk workers, and an Erlang notifier. It requires Oban v0.7 and adds new tables and an index to the schema.

Reinstalling the schema is required, and the pruner’s interval option was removed. Clusters shared with Elixir nodes should also switch the pruner to manual sync.

Bump Your Deps#

Update Oban and Pro to the latest versions:

dependencies = [
  "oban>=0.7.0",
  "oban-pro>=0.7.0",
]

Then upgrade both packages, reinstalling Pro to renew it:

uv sync --upgrade-package oban --upgrade-package oban-pro --reinstall-package oban-pro

Oban v0.7 adds job timeouts, a shutdown grace period, and the extension points the Pro Pruner is built on.

Reinstall the Schema (Required)#

Oban Pro v0.7 adds the oban_pruners and oban_jobs_archive tables, an index for chunk lookups, and an updated oban_state_to_bit function. Run the install command again:

obanpro install

Or apply install_sql() through a new migration in your migration framework. Installation is idempotent, and only the missing tables, indexes, and functions are created.

On large oban_jobs tables, creating oban_jobs_chunk_index blocks writes while it builds. Create the index concurrently beforehand, and the install will skip it:

CREATE INDEX CONCURRENTLY IF NOT EXISTS oban_jobs_chunk_index
ON oban_jobs ((meta->>'chunk_id'), state, priority, scheduled_at, id)
WHERE meta ? 'chunk_id';

Replace the Pruner Interval#

The Pro Pruner runs on a cron schedule rather than an interval, and the interval option now raises an error. Replace it with an equivalent schedule:

 [pruner]
-interval = 60
+schedule = "* * * * *"

The top-level max_age still applies to the default rule. Pruning now skips jobs that belong to an active workflow, so jobs from long-running workflows are kept longer than before.

Use Manual Pruner Sync in Mixed Clusters#

Configured pruner rules are the source of truth by default, and persisted rules missing from the configuration are deleted on start. In a cluster shared with Elixir nodes, or where rules are managed from Oban Web, switch to manual sync before upgrading so Python nodes don’t delete rules they didn’t configure:

[pruner]
sync_mode = "manual"