Re: Partitioned checkpointing

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: Simon Riggs <simon(at)2ndQuadrant(dot)com>
Cc: Takashi Horikawa <t-horikawa(at)aj(dot)jp(dot)nec(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Partitioned checkpointing
Date: 2015-09-11 16:28:30
Message-ID: alpine.DEB.2.10.1509111813310.21797@sto
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Hello Simon,

> The idea to do a partial pass through shared buffers and only write a
> fraction of dirty buffers, then fsync them is a good one.

Sure.

> The key point is that we spread out the fsyncs across the whole checkpoint
> period.

Yes, this is really Andres suggestion, as I understood it.

> I think we should be writing out all buffers for a particular file in one
> pass, then issue one fsync per file. >1 fsyncs per file seems a bad idea.

This is one of the things done in the "checkpoint continuous flushing"
patch, as buffers are sorted, they are written per file, and in order
within a file, which help getting sequencial writes instead of random
writes.

See https://commitfest.postgresql.org/6/260/

However for now the final fsync is not called, but Linux is told that the
written buffers must be flushed, which is akin to an "asynchronous fsync",
i.e. it asks to move data but does not wait for the data to be actually
written, as a blocking fsync would.

Andres suggestion, which has some common points to Takashi-san patch, is
to also integrate the fsync in the buffer writing process. There are some
details to think about, because probably it is not a a good to issue an
fsync right after the corresponding writes, it is better to wait for some
delay before doing so, so the implementation is not straightforward.

--
Fabien.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2015-09-11 16:29:42 Re: Partitioned checkpointing
Previous Message Andres Freund 2015-09-11 16:24:41 Re: WIP: Make timestamptz_out less slow.