Skip to content

RFC 331: Isolate migration routines

Administrator requested to merge ef/refactor-oobmigration-isolation into main

Created by: efritz

Fixes https://github.com/sourcegraph/sourcegraph/issues/18407 and https://github.com/sourcegraph/sourcegraph/issues/18408.

Previously, the runner would run Up/Down migrations in lock step in each batch. This means that everything is run sequentially and a poorly performing migration will slow down all other migrations.

Now, the runner is a simple coordinator over a set of goroutines. Each registered migrator that matches a database record will spawn a single goroutine, which will process the migrator periodically and independently of all other migration routines. One slow migration will not affect the timing of others. This also allow us to separate the clock machinery of each migrator so we can configure each timeout independently.

Merge request reports

Loading