I am setting up Postgres v14 database. I have a question related to the max_wal_size
and wal_keep_size
parameters.
According to the documentation:
max_wal_size
⇒ Maximum size to let the WAL grow during automatic checkpoints. This is a soft limit; WAL size can exceed max_wal_size
under special circumstances, such as heavy load, a failing archive_command
, or a high wal_keep_size
setting.
wal_keep_size
⇒ Specifies the minimum size of past log file segments kept in the pg_wal
directory, in case a standby server needs to fetch them for streaming replication.
What will happen if the value of wal_keep_size
is greater than the value of max_wal_size
, and the standby server is slow and lagging in replication by more than wal_keep_size
?
wal_keep_size
worth of data will be retained in the WAL directory on the primary. But since the WAL files size exceeded max_wal_size
, will the checkpoint keep running until the size comes down below max_wal_size
?