pg_auto_failover
pg_auto_failover copied to clipboard
Promotion refusal log names the wrong setting
Hi. Small bug in a log message.
When the monitor refuses to promote a standby because it is too far behind, the log line says the limit is pgautofailover.enable_sync_wal_log_threshold.
But the check in the code does not use that setting. In src/monitor/group_state_machine.c the comparison uses PromoteXlogThreshold, which is pgautofailover.promote_wal_log_threshold.
So if an operator reads the log and changes the setting it names, nothing changes. The setting that matters is the other one.
Found on v2.2 while I was testing failover behaviour. The gate itself works fine — this is only about the log text.
Fix idea: make the log line name promote_wal_log_threshold. Happy to send a patch if you want one.