Re: Spreading full-page writes

From: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Andres Freund <andres(at)2ndquadrant(dot)com>, Simon Riggs <simon(at)2ndquadrant(dot)com>
Subject: Re: Spreading full-page writes
Date: 2014-05-27 08:49:07
Message-ID: 53845183.6060007@vmware.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 05/26/2014 11:15 PM, Robert Haas wrote:
> On Mon, May 26, 2014 at 1:22 PM, Heikki Linnakangas
> <hlinnakangas(at)vmware(dot)com> wrote:
>>> I don't think we know that. The server might have crashed before that
>>> second record got generated. (This appears to be an unfixable flaw in
>>> this proposal.)
>>
>> The second record is generated before the checkpoint is finished and the checkpoint record is written. So it will be there.
>>
>> (if you crash before the checkpoint is finished, the in-progress checkpoint is no good for recovery anyway, and won't be used)
>
> Hmm, I see.
>
> It's not great to have to generate WAL at buffer-eviction time,
> though. Normally, when we go to evict a buffer, the WAL is already
> written. We might have to wait for it to be flushed, but if the WAL
> writer is doing its job, hopefully not. But here we'll definitely
> have to wait for the WAL flush.

Yeah. You would want to batch the flushes somehow, instead of flushing
the WAL for every buffer being flushed. For example, after writing the
FPW WAL record, just continue with the checkpoint without flushing the
buffer, and do a second pass later doing buffer flushes.

- Heikki

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Sandro Santilli 2014-05-27 08:57:31 Re: postgres_fdw and connection management
Previous Message Fujii Masao 2014-05-27 07:49:00 Re: Spreading full-page writes