Re: Can PostgreSQL create new WAL files instead of reusing old ones? - Mailing list pgsql-general

From Tom Lane
Subject Re: Can PostgreSQL create new WAL files instead of reusing old ones?
Date
Msg-id 2384.1523991423@sss.pgh.pa.us
Whole thread Raw
In response to Re: Can PostgreSQL create new WAL files instead of reusing old ones?  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Responses Re: Can PostgreSQL create new WAL files instead of reusing old ones?  (David Pacheco <dap@joyent.com>)
Re: Can PostgreSQL create new WAL files instead of reusing old ones?  (Michael Paquier <michael@paquier.xyz>)
List pgsql-general
Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
> David Pacheco wrote:
>> tl;dr: We've found that under many conditions, PostgreSQL's re-use of old
>> WAL
>> files appears to significantly degrade query latency on ZFS.  The reason is
>> complicated and I have details below.  Has it been considered to make this
>> behavior tunable, to cause PostgreSQL to always create new WAL files
>> instead of re-using old ones?

> I don't think this has ever been proposed, because there was no use case
> for it.  Maybe you want to work on a patch for it?

I think possibly the OP doesn't understand why it's designed that way.
The point is not really to "recycle old WAL files", it's to avoid having
disk space allocation occur during the critical section where we must
PANIC on failure.  Now, of course, that doesn't really work if the
filesystem is COW underneath, because it's allocating fresh disk space
anyway even though semantically we're overwriting existing data.
But what I'd like to see is a fix that deals with that somehow, rather
than continue to accept the possibility of ENOSPC occurring inside WAL
writes on these file systems.  I have no idea what such a fix would
look like :-(

            regards, tom lane


pgsql-general by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Can PostgreSQL create new WAL files instead of reusing old ones?
Next
From: David Pacheco
Date:
Subject: Re: Can PostgreSQL create new WAL files instead of reusing old ones?