Skip to content

Cleanup MigrationItemJob#1587

Merged
netomi merged 2 commits intomasterfrom
fix-migration-and-mirror-jobs
Feb 6, 2026
Merged

Cleanup MigrationItemJob#1587
netomi merged 2 commits intomasterfrom
fix-migration-and-mirror-jobs

Conversation

@netomi
Copy link
Contributor

@netomi netomi commented Feb 5, 2026

The current migration item job had various issues:

  • did report wrong number of migration items that are processed
  • did not cleanup correctly the recurring job in some edge cases (e.g. in a staging environment with often changing versions)

The PR does the following:

  • delete all remaining migration items in the db as the previous migration is completed now
  • give the recurring job to schedule migration items a stable name
  • delete the recurring job once no migration items are remaining anymore

Previously the recurring job was including the registry version, however that lead to the case where the recurring job was not deleted when updating the service and there are still migrations to schedule.

These recurring jobs remain and will be continuously executed unless manually deleted as the id was tied to the registry version the app is configured with. With a stable id, it should correctly delete the recurring jobs once done.

The recurring job should only be created once with ovsx.migrations.once-per-version is enabled, so there is no need to also give the recurring job an id that is derived from the version.

A further improvement would be to delete migration items once the scheduled migration for that item is completed.
Now it feels weird that you see migration items in the DB that have already been completed, but their status is just set to "scheduled". It seems in the past, db migrations where just deleting the items from the table with the next version.

…s left anymore, correctly output the migraiton items to be processed, delete all existing migration items from the table as migraiton is done
@netomi netomi force-pushed the fix-migration-and-mirror-jobs branch from 594d94e to 9392bfb Compare February 6, 2026 21:06
@netomi netomi merged commit 50e162e into master Feb 6, 2026
8 checks passed
@netomi netomi deleted the fix-migration-and-mirror-jobs branch February 6, 2026 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant