We set our max_wal_size
to 24 GB recently (from the 1 GB default), did some testing, and then set it to 12 GB followed by a server restart. When I query the size of the WAL on the filesystem (total size of files in pg_xlog
directory), it still shows as about 20 GB. I have issued a manual checkpoint and restarted the server, but the WAL hasn't shrunk back down to 12 GB. This is a pretty simple implementation -- no replication nor archiving in place and there are no long-running transactions that exist. Am I misunderstanding how this is supposed to work? Does it not delete the old WAL files when you lower the max_wal_size
value and when all transactions have been been completed and the server restarts?
Postgres version: 9.6.15
OS: Linux Ubuntu 16.04.6 LTS
Settings:
max_wal_size = 12GB
min_wal_size = 80MB
wal_keep_segments = 0
checkpoint_timeout = 15min
checkpoint_completion_target = 0.87
wal_compression = off
archive_mode = off
wal_level = minimal