summaryrefslogtreecommitdiff
path: root/doc/development/background_migrations.md
diff options
context:
space:
mode:
authorYorick Peterse <yorickpeterse@gmail.com>2018-07-19 17:16:47 +0200
committerYorick Peterse <yorickpeterse@gmail.com>2018-08-06 15:20:36 +0200
commit91b752dce63147bc99d7784d3d37865efb5e9352 (patch)
tree447dcd9dc5efcb14af5439f247d87938daf845dc /doc/development/background_migrations.md
parent5f742eb95a0080343167469ccabfeccd3630007d (diff)
downloadgitlab-ce-91b752dce63147bc99d7784d3d37865efb5e9352.tar.gz
Respond to DB health in background migrations
This changes the BackgroundMigration worker so it checks for the health of the DB before performing a background migration. This in turn allows us to reduce the minimum interval, without having to worry about blowing things up if we schedule too many migrations. In this setup, the BackgroundMigration worker will reschedule jobs as long as the database is considered to be in an unhealthy state. Once the database has recovered, the migration can be performed. To determine if the database is in a healthy state, we look at the replication lag of any replication slots defined on the primary. If the lag is deemed to great (100 MB by default) for too many slots, the migration is rescheduled for a later point in time. The health checking code is hidden behind a feature flag, allowing us to disable it if necessary.
Diffstat (limited to 'doc/development/background_migrations.md')
-rw-r--r--doc/development/background_migrations.md3
1 files changed, 3 insertions, 0 deletions
diff --git a/doc/development/background_migrations.md b/doc/development/background_migrations.md
index 16195cbbbdf..f0d5af9fcb5 100644
--- a/doc/development/background_migrations.md
+++ b/doc/development/background_migrations.md
@@ -5,6 +5,9 @@ otherwise take a very long time (hours, days, years, etc) to complete. For
example, you can use background migrations to migrate data so that instead of
storing data in a single JSON column the data is stored in a separate table.
+If the database cluster is considered to be in an unhealthy state, background
+migrations automatically reschedule themselves for a later point in time.
+
## When To Use Background Migrations
>**Note:**