On Fri, Sep 18, 2020 at 8:10 AM Michael Paquier <mich...@paquier.xyz> wrote:
> On Thu, Sep 17, 2020 at 10:20:16AM +0200, Oleksandr Shulgin wrote: > > Ouch. I think pg_rewind shouldn't try to remove any random files in > pg_wal > > that it doesn't know about. > > What if the administrator made a backup of some WAL segments there? > > IMO, this would be a rather bad strategy anyway, so just don't do > that, because that could also mean that this is on the same partition > as pg_wal/ which would crash the server if the partition has the idea > to get full even if max_wal_size is set correctly. To clarify my point, I don't mean to backup WAL segments in the background when the server is running, but precisely when the server is down and you need to intervene, such as running pg_rewind. You might want to "stash" some of the latest segments in case you need to start over (name it pg_wal/0000008400000A760000001E.backup, or pg_wal/backup/0000008400000A760000001E). It is surprising that pg_rewind might want to decide to remove those. -- Alex