Re: [HACKERS] [PATCHES] wal_checksum = on (default) | off

From: Gregory Stark <stark(at)enterprisedb(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Simon Riggs" <simon(at)2ndquadrant(dot)com>, "Bruce Momjian" <bruce(at)momjian(dot)us>, "Jim Nasby" <decibel(at)decibel(dot)org>, "Zeugswetter Andreas ADI SD" <ZeugswetterA(at)spardat(dot)at>, <pgsql-hackers(at)postgresql(dot)org>, <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [HACKERS] [PATCHES] wal_checksum = on (default) | off
Date: 2007-01-11 14:59:26
Message-ID: 87vejdwqwh.fsf@stark.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

"Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:

> "Simon Riggs" <simon(at)2ndquadrant(dot)com> writes:
>> COPY XLogInsert() #1 on oprofile results at 17% CPU
>> (full_page_writes = on)
>
> But what portion of that is actually CRC-related? XLogInsert does quite
> a lot.
>
> Anyway, I can't see degrading the reliability of the system for a gain
> in the range of a few percent, which is the most that we'd be likely
> to get here ... for a factor of two or more, maybe people would be
> willing to take a risk.

Well the problem with that is when you have dozens of 1% improvements which
are additive and the net negative effects aren't additive. Since we can't
quantify the effect on reliability here it's hard to tell if that's the case.

What did you think about protecting against torn writes using id numbers every
512 bytes. That "improves" the reliability of the system in that it detects
torn writes 100% of the instead of just (2^32-1)/2^32 (or 99.99999998%) of the
time. (which poking a hole in the CRC mechanism would reduce to (2^31-1)/2^31
(or 99.99999995%)).

I don't think either of those percentages are significant. If you crash your
system once a day and always get a torn WAL page you're still far more likely
to still get corrupted data due to cosmic rays long before you get corrupted
data due to mistakenly applying a torn page from WAL.

But if we can save CPU on every WAL write while not harming reliability (in
fact increasing it, albeit insignificantly) why not?

--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dave Cramer 2007-01-11 15:05:24 wal buffers documentation -errata
Previous Message Simon Riggs 2007-01-11 14:54:52 Re: [HACKERS] [PATCHES] wal_checksum = on (default) | off

Browse pgsql-patches by date

  From Date Subject
Next Message Dave Cramer 2007-01-11 15:05:24 wal buffers documentation -errata
Previous Message Simon Riggs 2007-01-11 14:54:52 Re: [HACKERS] [PATCHES] wal_checksum = on (default) | off