Re: checkpoint writeback via sync_file_range - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: checkpoint writeback via sync_file_range
Date
Msg-id CA+U5nMJz4dc3TxNPHjnSidzXm1CoLM3YnxwbgqUseYWT2h+nxw@mail.gmail.com
Whole thread Raw
In response to Re: checkpoint writeback via sync_file_range  (Simon Riggs <simon@2ndQuadrant.com>)
List pgsql-hackers
On Wed, Jan 11, 2012 at 9:28 AM, Simon Riggs <simon@2ndquadrant.com> wrote:

> It does open the door to various other uses, so I think this work will
> be useful.

Yes, I think this would allow a better design for the checkpointer.

Checkpoint scan will collect buffers to write for checkpoint and sort
them by fileid, like Koichi/Itagaki already suggested.

We then do all the writes for a particular file, then issue a
background sync_file_range, then sleep a little. Loop. At end of loop,
collect up and close the sync_file_range calls with a
SYNC_FILE_RANGE_WAIT_AFTER.

So we're interleaving the writes and fsyncs throughout the whole
checkpoint, not bursting the fsyncs at the end.

With that design we would just have a continuous checkpoint, rather
than having 0,5 or 0.9

--
 Simon Riggs                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: [WIP] Double-write with Fast Checksums
Next
From: Andres Freund
Date:
Subject: Re: checkpoint writeback via sync_file_range