> If you are going to double buffer, one presumes that for some non-zero
> period of time, the block must be locked during which it is copied. You
> wouldn't want it changing "mid-copy" would you? How is this any less of a
> hit than just calculating the checksum?
a) You wouldn't have to keep the lock while doing the I/O. Once the CRC+copy
is done you can release the lock secure in the knowledge that nobody is going
to modify your buffered copy before the kernel can grab its copy.
b) You don't have to worry about hint bits being modified underneath you. As
long as the CRC+copy is carefully written to copy whole atomic-sized
words/bytes and only read the original once then it won't matter if it catches
the hint bit before or after it's set. The CRC will reflect the value buffered
and eventually written.
Ask me about EnterpriseDB's RemoteDBA services!
In response to
pgsql-hackers by date
|Next:||From: Tom Lane||Date: 2008-10-01 23:41:24|
|Subject: Re: Block-level CRC checks |
|Previous:||From: Matthew T. O'Connor||Date: 2008-10-01 23:18:22|
|Subject: Re: September CommitFest Closed|