Upgrading to v1.6
This release brings powerful workflow enhancements, overhauled queue partitioning, improved dynamic plugins, and various optimizations and usability improvements.
Before Upgrading
The v1.6 migration adds generated columns and indexes for improved partitioning and workflows.
This may cause downtime due to table locking if your oban_jobs
table contains millions of
records. This is particularly impactful for systems with long retention policies.
To minimize disruption:
- First upgrade to Pro v1.5.4+ and let it pre-generate partition keys for jobs in partitioned queues.
- Consider reducing your table size by pruning old jobs before migration
- Schedule the migration during low-traffic periods
- For very large tables, consider splitting the migration into manual steps with concurrent index creation
Bump Your Deps
Update Oban and Pro to the latest versions:
{:oban_pro, "~> 1.6.0-rc.0", repo: "oban"},
Run Oban.Pro.Migration
Generate a new migration:
$ mix ecto.gen.migration upgrade_oban_pro_to_1_6
Within the generated migration module:
use Ecto.Migration
def up, do: Oban.Pro.Migration.up(version: "1.6.0")
def down, do: Oban.Pro.Migration.down(version: "1.5.0")
See the Oban.Pro.Migration
module docs for additional options.
Configure DynamicQueues Persistence (Optional)
DynamicQueues now preserves runtime changes across application restarts. You can also configure
automatic queue deletion with the sync_mode
option.
# Automatically delete queues missing from configuration
config :my_app, Oban,
plugins: [{DynamicQueues, sync_mode: :automatic, queues: [...]}]
Configure Safe Hash for Uniqueness (Optional)
Enable "safe" hashing to avoid key collisions with seemingly unique values:
config :oban_pro, Oban.Pro.Utils, safe_hash: true
The resulting hash will apply to uniq_key
, chain_key
, and partition_key
values stored in job
meta. The generated values will not match the previous values for configurations that use
sub-fields in args
.