Can postgres ever delete the recycled future WAL files to free-up disk space if max_wal_size is reduced or wal_recycle is set to off? - Mailing list pgsql-hackers

From Bharath Rupireddy
Subject Can postgres ever delete the recycled future WAL files to free-up disk space if max_wal_size is reduced or wal_recycle is set to off?
Date
Msg-id CALj2ACU3ovReRGggVGK6Q+CwX1Aiy0NRo7qn8fg8Ke1vngo-bQ@mail.gmail.com
Whole thread Raw
Responses Re: Can postgres ever delete the recycled future WAL files to free-up disk space if max_wal_size is reduced or wal_recycle is set to off?  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Can postgres ever delete the recycled future WAL files to free-up disk space if max_wal_size is reduced or wal_recycle is set to off?  (Justin Pryzby <pryzby@telsasoft.com>)
List pgsql-hackers
Hi,

I have a scenario where max_wal_size = 10GB and wal_recycle = on, the
postgres starts to recycle and keep WAL files for future use,
eventually around 600~ WAL files have been kept in the pg_wal
directory. The checkpoints were happening at regular intervals. But
the disk was about to get full (of course scaling up disk is an
option) but to avoid "no space left on device" crashes, changed
max_wal_size = 5GB, and issued a checkpoint, thinking that postgres
will free up the 5GB of disk space. It seems like that's not the case
because postgres will not remove future WAL files even after
max_wal_size is reduced, but if it can delete the future WAL file(s)
immediately, the server would have had 5GB free disk space to keep the
server up avoiding crash and meanwhile disk scaling can be performed.

Can postgres delete the recycled future WAL files once max_wal_size is
reduced and/or wal_recycle is set to off?

Thoughts?

Regards,
Bharath Rupireddy.



pgsql-hackers by date:

Previous
From: "David G. Johnston"
Date:
Subject: Select Reference Page - Make Join Syntax More Prominent
Next
From: Tom Lane
Date:
Subject: Re: Can postgres ever delete the recycled future WAL files to free-up disk space if max_wal_size is reduced or wal_recycle is set to off?