Re: Block-level CRC checks

From: Mark Mielke <mark(at)mark(dot)mielke(dot)cc>
To: Aidan Van Dyk <aidan(at)highrise(dot)ca>
Cc: Gregory Stark <stark(at)enterprisedb(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Jonah H(dot) Harris" <jonah(dot)harris(at)gmail(dot)com>, pgsql(at)mohawksoft(dot)com, Hannu Krosing <hannu(at)2ndquadrant(dot)com>, "Decibel!" <decibel(at)decibel(dot)org>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Block-level CRC checks
Date: 2008-10-01 17:00:36
Message-ID: 48E3ACB4.2090900@mark.mielke.cc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Aidan Van Dyk wrote:
> One possibility would be to "double-buffer" the write... i.e. as you
> calculate your CRC, you're doing it on a local copy of the block, which
> you hand to the OS to write... If you're touching the whole block of
> memory to CRC it, it isn't *ridiculously* more expensive to copy the
> memory somewhere else as you do it...
>

Coming in to this late - so apologies if this makes no sense - but
doesn't writev() provide the required capability?

Also, what is the difference between the OS not writing the block at
all, and writing the block but missing the checksum? This window seems
to be small enough (most of the time being faster than the system can
schedule the buffer to be dumped?) that the "additional risk" seems
theoretical rather than real. Unless there is evidence that writev()
performs poorly, I'd suggest that avoiding double-buffering by using
writev() would be preferred.

Cheers,
mark

--
Mark Mielke <mark(at)mielke(dot)cc>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Mark Mielke 2008-10-01 17:07:22 Re: Block-level CRC checks
Previous Message Paul Schlie 2008-10-01 16:27:35 Re: Block-level CRC checks