Re: [PATCHES] wal_checksum = on (default) | off - Mailing list pgsql-hackers

From Gregory Stark
Subject Re: [PATCHES] wal_checksum = on (default) | off
Date
Msg-id 87r6u1wn8j.fsf@stark.xeocode.com
Whole thread Raw
In response to Re: [PATCHES] wal_checksum = on (default) | off  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [PATCHES] wal_checksum = on (default) | off
List pgsql-hackers
"Tom Lane" <tgl@sss.pgh.pa.us> writes:

> Gregory Stark <stark@enterprisedb.com> writes:
>> What did you think about protecting against torn writes using id numbers every
>> 512 bytes.
>
> Pretty much not happening; or are you volunteering to fix every part of
> the system to tolerate injections of inserted data anywhere in a stored
> datum?

I was thinking to do it at a low level as the xlog records are prepared to be
written to the filesystem and as the data is being read from disk. I haven't
read that code yet to see where to inject it but I understand there's already
a copy happening and it could be done there. Even if we optimize out all the
copies we could do it in the actual i/o call using readv/writev.

I wasn't thinking of doing it on actual disk buffers since it doesn't help us
avoid full page writes, but it could be done there too using readv/writev in
the smgr. That might be useful for a full_page_writes=off system so even if it
can't guarantee no corruption at least it can guarantee no silent corruption.

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

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [COMMITTERS] pgsql: Stamp major release 8.3.0,
Next
From: Tom Lane
Date:
Subject: Re: [PATCHES] wal_checksum = on (default) | off