Re: wal segment size

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Colin 't Hart <colinthart(at)gmail(dot)com>
Cc: Andrew <adhenry(dot)9(at)gmail(dot)com>, Greg Sabino Mullane <htamfids(at)gmail(dot)com>, PostgreSQL General <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: wal segment size
Date: 2025-12-19 14:48:45
Message-ID: 0e62db587431baddd981b7e1d1699df0d915bbaa.camel@cybertec.at
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, 2025-12-19 at 14:25 +0100, Colin 't Hart wrote:
> What's the behaviour when pg_resetwal is used to change the WAL segment size?
>
> This note is worrying to me:
> --
> While pg_resetwal will set the WAL starting address beyond the latest existing WAL segment file, some segment size changes can cause previous WAL file names to be reused. It is recommended to use -l together with this option to manually set the WAL starting address if WAL file name overlap will cause problems with your archiving strategy.
> --
> Why can a segment size change cause previous WAL file names to be reused?
>
> Do we need to take a new backup immediately after changing the WAL segment size?

I think that is supposed to mean that the new WAL numbering scheme might produce
the same WAL segment name as a WAL segment name had long ago, so you might overwrite
that earlier segment in the WAL archive, which could prevent you from recovering from
an old backup that needs the overwritten WAl segment to recover.

I'm not sure how likely that is to happen.

It never harms to run an extra backup.

The main thing is that you shut down PostgreSQL cleanly before running "pg_resetwal"
and that you only change the WAL segment size, nothing else.

Yours,
Laurenz Albe

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Greg Sabino Mullane 2025-12-19 14:49:48 Re: Dealing with SeqScans when Time-based Partitions Cut Over
Previous Message Colin 't Hart 2025-12-19 13:25:58 Re: wal segment size