Skip to content

Taking snapshots should support GITLAB_BACKUP_* overrides

Summary

GitLab provides a backup rake task that will take a backup of the database. This task supports multiple database setup. It is using the database configuration from Rails ActiveRecord, which is the same configuration as used by the application.

However, we do support overriding the Rails configuration using GITLAB_BACKUP_* environment variables. This is needed if the application is using for example PgBouncer for the database connections: we want to create backups using direct connection to the primary PostgreSQL instance.

Solution

This issue should address a few issues:

  1. Setting the snapshots must also support these GITLAB_BACKUP_* environment variables (it currently does not)
  2. Disabling the idle_in_transaction_session_timeout should also support these environment variables

Current impact

Customers on multiple connections that use PostgreSQL proxy servers (PgPool II, PgBouncer and others) can not use our database script right now.

Since we do not have such customers yet, impact is low. But when self-managed customers start using multiple databases, this will be an issue.

Edited by Rutger Wessels