Skip to content

Remove minimum_interval from BackgroundMigrationWorker

We had an issue on production where background migration jobs that were scheduled were constantly getting re-scheduled every time they were run. These were very quick jobs (duration of only a second or two), and there were a lot of them, ~70,000. gitlab-com/gl-infra/production#2820 (closed). This becomes an infinite loop.

From comment, it turns out that the minimum_interval in background_migration_worker.rb keeps migration classes of the same class from running within 2 minutes of each other.

It might be worth removing this:

From @stanhu in gitlab-com/gl-infra/production#2820 (comment 429861686)

I'm inclined to delete that minimum interval check. It seems like it causes more harm than good. It's too easy to write a background migration that finishes within a second, let alone 2 minutes.

Edited by Brett Walker