gitlab-org--gitlab-foss/lib/gitlab/database
Yorick Peterse 91b752dce6
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.
2018-08-06 15:20:36 +02:00
..
rename_reserved_paths_migration [Rails5] Disable inheritance_column for Gitlab::Database::RenameReservedPathsMigration::V1::MigrationClasses::Namespace 2018-06-16 13:11:50 +11:00
arel_methods.rb [Rails5] Fix Arel::UpdateManager 2018-04-29 12:54:58 +11:00
count.rb Fix fast admin counters not working when PostgreSQL has secondaries 2018-05-25 22:58:43 -07:00
date_time.rb
grant.rb Use has_table_privilege for TRIGGER on PostgreSQL 2018-01-22 13:43:38 +01:00
median.rb Rails5 fix arel from in mysql_median_datetime_sql 2018-06-26 00:35:47 +02:00
migration_helpers.rb Respond to DB health in background migrations 2018-08-06 15:20:36 +02:00
multi_threaded_migration.rb Prepare for zero downtime migrations 2017-04-12 18:15:19 +02:00
read_only_relation.rb
sha_attribute.rb [Rails5] Update type_cast_*_database methods 2018-04-06 10:57:19 +00:00