Re: Disable page writes when fsync off, add GUC

Lists: pgsql-hackerspgsql-patches
From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Disable page writes when fsync off, add GUC
Date: 2005-07-04 04:09:35
Message-ID: 200507040409.j6449ZX15512@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

This patch disables page writes to WAL when fsync is off, because with
no fsync guarantee, the page write recovery isn't useful.

This also adds a full_page_writes GUC to turn off page writes to WAL.
Some people might not want full_page_writes, but still might want fsync.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

Attachment Content-Type Size
unknown_filename text/plain 5.2 KB

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Disable page writes when fsync off, add GUC
Date: 2005-07-04 14:44:51
Message-ID: 20050704144451.GN24207@ns.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

* Bruce Momjian (pgman(at)candle(dot)pha(dot)pa(dot)us) wrote:
> This patch disables page writes to WAL when fsync is off, because with
> no fsync guarantee, the page write recovery isn't useful.

This doesn't seem quite right to me. What happens with PITR? And
Postgres crashes? While many people seriously distrust running w/ fsync
off, I'm sure there's quite a few folks which do.

> This also adds a full_page_writes GUC to turn off page writes to WAL.
> Some people might not want full_page_writes, but still might want fsync.

Adding an option to not do page writes to WAL seems fine to me, but I
think WAL writes should be on by default, even in the fsync=off case.
If people want to turn it off, fine, for either case since we expect
they understand what it means to have it turned off, but I don't think
the two options should be coupled as is being proposed.

Thanks,

Stephen


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: [PATCHES] Disable page writes when fsync off, add GUC
Date: 2005-07-04 14:48:55
Message-ID: 200507041448.j64EmtB01681@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Stephen Frost wrote:
-- Start of PGP signed section.
> * Bruce Momjian (pgman(at)candle(dot)pha(dot)pa(dot)us) wrote:
> > This patch disables page writes to WAL when fsync is off, because with
> > no fsync guarantee, the page write recovery isn't useful.
>
> This doesn't seem quite right to me. What happens with PITR? And

PITR doesn't need page writes at all because it has a full backup the
file system to start with. In fact with PITR the crashed file system
isn't used at all (restored from backup). In fact there is a TODO to
exclude full page writes from the PITR backup of WAL.

> Postgres crashes? While many people seriously distrust running w/ fsync
> off, I'm sure there's quite a few folks which do.
>
> > This also adds a full_page_writes GUC to turn off page writes to WAL.
> > Some people might not want full_page_writes, but still might want fsync.
>
> Adding an option to not do page writes to WAL seems fine to me, but I
> think WAL writes should be on by default, even in the fsync=off case.
> If people want to turn it off, fine, for either case since we expect
> they understand what it means to have it turned off, but I don't think
> the two options should be coupled as is being proposed.

That is a question I had in my mind. I added documentation that turning
off fsync also disables full_page_writes, but we could decouple them and
tell people to consider disableing full_pages_writes if they turn off
fsync, basically suggesting they make the second change.

Other opinions?

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Disable page writes when fsync off, add GUC
Date: 2005-07-04 16:00:49
Message-ID: 200507041800.49660.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Bruce Momjian wrote:
> This patch disables page writes to WAL when fsync is off, because
> with no fsync guarantee, the page write recovery isn't useful.
>
> This also adds a full_page_writes GUC to turn off page writes to WAL.
> Some people might not want full_page_writes, but still might want
> fsync.

Do you have some numbers to suggest that there is a performance benefit
to be had?

--
Peter Eisentraut
http://developer.postgresql.org/~petere/


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Disable page writes when fsync off, add GUC
Date: 2005-07-04 16:04:55
Message-ID: 200507041604.j64G4tq13297@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Peter Eisentraut wrote:
> Bruce Momjian wrote:
> > This patch disables page writes to WAL when fsync is off, because
> > with no fsync guarantee, the page write recovery isn't useful.
> >
> > This also adds a full_page_writes GUC to turn off page writes to WAL.
> > Some people might not want full_page_writes, but still might want
> > fsync.
>
> Do you have some numbers to suggest that there is a performance benefit
> to be had?

Josh reported page writes to be a big hit (which we already knew), but I
don't have any with fsync off, though it seems like a no-brainer.
However, I am thinking decoupling them is best.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Stephen Frost <sfrost(at)snowman(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCHES] Disable page writes when fsync off, add GUC
Date: 2005-07-05 15:54:47
Message-ID: 23360.1120578887@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> That is a question I had in my mind. I added documentation that turning
> off fsync also disables full_page_writes, but we could decouple them and
> tell people to consider disableing full_pages_writes if they turn off
> fsync, basically suggesting they make the second change.

> Other opinions?

I'm for treating them as independent options.

regards, tom lane


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Stephen Frost <sfrost(at)snowman(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCHES] Disable page writes when fsync off, add GUC
Date: 2005-07-05 18:23:50
Message-ID: 200507051823.j65INpc14738@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > That is a question I had in my mind. I added documentation that turning
> > off fsync also disables full_page_writes, but we could decouple them and
> > tell people to consider disableing full_pages_writes if they turn off
> > fsync, basically suggesting they make the second change.
>
> > Other opinions?
>
> I'm for treating them as independent options.

Agreed. I will modify and apply.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Disable page writes when fsync off, add GUC
Date: 2005-07-05 23:19:14
Message-ID: 200507052319.j65NJEF07002@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Bruce Momjian wrote:
> This also adds a full_page_writes GUC to turn off page writes to WAL.
> Some people might not want full_page_writes.

Fsync linkage removed, patch attached and applied.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

Attachment Content-Type Size
unknown_filename text/plain 5.8 KB

From: "Michael Paesold" <mpaesold(at)gmx(dot)at>
To: "PostgreSQL-patches" <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Disable page writes when fsync off, add GUC
Date: 2005-07-06 08:23:32
Message-ID: 03eb01c58204$00e5d6f0$0f01a8c0@zaphod
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Bruce Momjian wrote:

> Bruce Momjian wrote:
>> This also adds a full_page_writes GUC to turn off page writes to WAL.
>> Some people might not want full_page_writes.
>
> Fsync linkage removed, patch attached and applied.

...
+ When this option is on, the <productname>PostgreSQL</> server
+ writes full pages to WAL when they first modified after a checkpoint
+ so full recovery is possible.

I believe this should be "when they _are_ first modified after".

Perhaps you should also mention power failure, not only an operating system
crash as disaster scenario, even if the latter includes the former.

Best Regards,
Michael Paesold


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Michael Paesold <mpaesold(at)gmx(dot)at>
Cc: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Disable page writes when fsync off, add GUC
Date: 2005-07-06 14:45:13
Message-ID: 200507061445.j66EjDf17572@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Michael Paesold wrote:
> Bruce Momjian wrote:
>
> > Bruce Momjian wrote:
> >> This also adds a full_page_writes GUC to turn off page writes to WAL.
> >> Some people might not want full_page_writes.
> >
> > Fsync linkage removed, patch attached and applied.
>
> ...
> + When this option is on, the <productname>PostgreSQL</> server
> + writes full pages to WAL when they first modified after a checkpoint
> + so full recovery is possible.
>
> I believe this should be "when they _are_ first modified after".
>
> Perhaps you should also mention power failure, not only an operating system
> crash as disaster scenario, even if the latter includes the former.
>

Thanks. Done.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

Attachment Content-Type Size
unknown_filename text/plain 1.4 KB