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.
Mark Mielke <mark(at)mielke(dot)cc>
In response to
pgsql-hackers by date
|Next:||From: Mark Mielke||Date: 2008-10-01 17:07:22|
|Subject: Re: Block-level CRC checks|
|Previous:||From: Paul Schlie||Date: 2008-10-01 16:27:35|
|Subject: Re: Block-level CRC checks |