You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Have a primary with config_dir outside the data directory
Patroni (on startup/restart e.g.) copies config_dir/postgresql.base.conf to PGDATA/postgresql.base.conf.backup
On standby bootstrap, basebackup method streams postgresql.base.conf.backup into standby's PGDATA along with the rest
Patroni restores PGDATA/postgresql.base.conf.backup to config_dir/postgresql.base.conf, overwriting the original one (if there was one)
Postgres potentially does not start, in case the new version of postgresql.base.conf has wrong data for the local node (e.g. wrong data_directory)
Expected behavior
I think Patroni should not overwrite local configuration files with a backup from the primary, but I'm not exactly what happens in the general case. One possibility would be to store the .backup files in config_dir as well and then restore them from there (thus avoiding the .backup files in PGDATA), but not sure whether that would break on update or something?
A work-around is to make sure PGDATA/postgresql.base.conf.backup does not exits on the primary before bootstrapping the standby.
Well, or Patroni needs to be more explicit that postgresql.base.conf must be identical on all nodes, which I am not sure is a reasonable requirement seeing how people put e.g. local IP addresses or hostnames into things like syslog_ident etc.
Environment
Patroni version: 2.1.4
PostgreSQL version: 13.7
DCS (and its version): etcd3
The text was updated successfully, but these errors were encountered:
mbanck
pushed a commit
to credativ/patroni
that referenced
this issue
Jul 29, 2022
Before, the .backup files were always stored in the data directory. However, if
there is a distinct configuration directory, it seems logical to put them
there. If config_dir is not configured, it defaults back to the data directory,
so this will not change things for setups where postgresql.conf is in the data
directory.
On the other hand, it will help with setups where postgresql.conf is outside
the data directory and has local changes. In this case, those no longer get
overwritten on boostrap/clone from the primary's backup configuration file that
is streamed to the boostrapped node.
Closezalando#2370
Describe the bug
config_dir
outside the data directoryconfig_dir/postgresql.base.conf
toPGDATA/postgresql.base.conf.backup
postgresql.base.conf.backup
into standby'sPGDATA
along with the restPGDATA/postgresql.base.conf.backup
toconfig_dir/postgresql.base.conf
, overwriting the original one (if there was one)postgresql.base.conf
has wrong data for the local node (e.g. wrongdata_directory
)Expected behavior
I think Patroni should not overwrite local configuration files with a backup from the primary, but I'm not exactly what happens in the general case. One possibility would be to store the
.backup
files inconfig_dir
as well and then restore them from there (thus avoiding the.backup
files in PGDATA), but not sure whether that would break on update or something?A work-around is to make sure
PGDATA/postgresql.base.conf.backup
does not exits on the primary before bootstrapping the standby.Well, or Patroni needs to be more explicit that
postgresql.base.conf
must be identical on all nodes, which I am not sure is a reasonable requirement seeing how people put e.g. local IP addresses or hostnames into things likesyslog_ident
etc.Environment
The text was updated successfully, but these errors were encountered: