patroni icon indicating copy to clipboard operation
patroni copied to clipboard

Correct log message for PG restart on replication config changes

Open NikolayS opened this issue 4 years ago • 2 comments

When some replication-related changes happen (e.g., restore_command is changed), Patroni restarts Postgres and the following can bee seen in logs:

INFO: changing primary_conninfo and restarting in progress

This message is misleading because it mentions one particular parameter but the change could happen with a different one (e.g., restore_command).

This is a quick improvement that makes the messaging better. In the future, it would make sense to report the diff of changes (hence, particular root cause of the restart) that is analyzed in config.py:record_missmatch.

NikolayS avatar May 10 '21 17:05 NikolayS

@CyberDem0n we've discussed this in person – what do you think to adjust the log message (maybe making it a bit shorter), while planning to implement config diff reported in logs explicitly? (The main idea I have is that we need to see what exactly has changed – but I guess it might be non-trivial and long, so let's have some simple improvement first).

NikolayS avatar May 10 '21 17:05 NikolayS

A shorter message could be just: changing replication-related parameters and restarting

The list of params being checked can be found here: https://github.com/zalando/patroni/blob/51cda9fb6e32cccc565fcb6ac52f1883c9156dd9/patroni/postgresql/config.py#L707

What I see there:

  • archive_cleanup_command
  • promote_trigger_file
  • recovery_end_command
  • restore_command
  • recovery_min_apply_delay
  • standby_mode
  • primary_slot_name

NikolayS avatar May 10 '21 17:05 NikolayS