Skip to content

Praefect: render database section in config.toml

Jacob Vosmaer requested to merge jv-praefect-sql into master

This change makes it possible to render the [database] section in Praefect's configuration file. This config section was introduced in gitaly!1662 (merged).

This is part of gitaly#1755 (closed).

This change highlights the somewhat unusual fact that there is no good way for us to configure Praefect by default in Omnibus.

Postgres is a hard dependency for Praefect. So why not automatically hook Praefect up to the embedded Postgres server of Omnibus? We could be writing Chef code in this MR that creates a database and a role for Praefect in the embedded Postgres server, and that fills in the host, port, credentials and database name in Praefect's config file.

We are intentionally not doing this. The intended use of Praefect is in HA deployments, where Postgres must also be HA. That makes it very unlikely that Postgres and Praefect are deployed on the same machine managed by Omnibus. I think it would send a wrong signal if we automate the creation of "toy setups" that are clearly not what you want in production.

In a production deployment of Praefect you have to be using some form of configuration management to set up multiple Praefect instances to work with the same Postgres database, and some form of (possibly manual) process to do the one-time task of creating a Praefect role and database in Postgres. In this kind of scenario, Omnibus acts as a pass-through mechanism, where we just want to be able to put config values in /etc/gitlab/gitlab.rb that then end up correctly rendered in individual config files.

Edited by GitLab Release Tools Bot

Merge request reports