Question

What will happen, if max_wal_size gets exceeded during backup?

Specifically, let's consider the following scenario on master:

  1. Set max_wal_size to a very low number.
  2. Run SELECT pg_start_backup('label', true); to create a checkpoint.
  3. Perform lots of transactions, so that max_wal_size is exceeded.

If I am right, PostgreSQL cannot process WAL files, because doing so would pollute the checkpoint. On the other hand, no new WAL files can be created, because of the limit.

Was it helpful?

Solution

max_wal_size is a soft limit - under many scenarios it gets crossed. Specifically as for pg_start_backup it just commits and outputs the wal location - if you have archiving in place than you have nothing to worry about.

Starting the backup will create more wal files but doesn't prevent rolling them - that's why you need the archiving as all wal files generated in the duration of the backup are needed for a successful restore.

See: max_wal_size documentation Also: backup documentation

Licensed under: CC-BY-SA with attribution
Not affiliated with dba.stackexchange
scroll top