Re: Block-level CRC checks - Mailing list pgsql-hackers

From Mark Mielke
Subject Re: Block-level CRC checks
Date
Msg-id 48E3ACB4.2090900@mark.mielke.cc
Whole thread Raw
In response to Re: Block-level CRC checks  (Aidan Van Dyk <aidan@highrise.ca>)
List 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@mielke.cc>



pgsql-hackers by date:

Previous
From: Paul Schlie
Date:
Subject: Re: Block-level CRC checks
Next
From: Mark Mielke
Date:
Subject: Re: Block-level CRC checks