opdev/synapse-operator

Remove the need of creating a intermediate dummy DB in the PostgresCluster

Opened this issue · 0 comments

Synapse requires the synapse database to be configured with collation = C. See https://github.com/matrix-org/synapse/blob/master/docs/postgres.md#fixing-incorrect-collate-or-ctype and https://github.com/matrix-org/synapse/blob/master/docs/postgres.md#set-up-database

The postgres-operator doesn't seem to provide this configuration option out of the box. The workaround in place consists of:

  • creating a dummy database for the synapse user, as part of the creation of the PostgresCluster object for Synapse. This dummy database will be configured with LOCAL='UTF-8' as this is the default value
  • pass a init script to the PostgresCluster, which deleted the dummy DB and create a synapse DB with the correct collation value.

As a consequence, the database specified in the postgres Secret, holding the database connection information, is referencing dummy rather than the actual database name (synapse).