hapostgres / pg_auto_failover

Postgres extension and service for automated failover and high-availability
Other
1.07k stars 112 forks source link

How can I configure the maximum number of WAL segments a standby can lag behind the primary in pg_auto_failover? #1027

Open zubingo opened 5 months ago

zubingo commented 5 months ago

Summary

I'm using pg_auto_failover for automatic failover and I'm trying to understand how to configure the maximum number of WAL segments a standby can lag behind the primary.

Details

In the documentation, it's mentioned that failover might lead to some data loss, but failover is not initiated if the secondary is more than 10 WAL segments (by default) behind on the primary. I would like to know how I can configure this value. I couldn't find any such configuration option in the documentation or in the pg_autoctl command.

Thanks!

xinferum commented 1 month ago

Hello.

I think setting the pg_auto_failover.promote_wal_log_threshold parameter will help in your question. See the description of the parameter in the documentation here https://pg-auto-failover.readthedocs.io/en/main/ref/configuration.html?highlight=lag#configuring-pg-auto-failover