On 21/08/2011 11:07 PM, A J wrote:
Nope, there are no checksums. It's the storage subsystem's job to make sure it doesn't mangle data on disk and reads the data as it was written. It's the OS's job to make sure nobody else overwrites or messes with that data while it's in RAM cache or on disk. Index corruption means you've hit a hardware fault, OS bug, or possibly a PostgreSQL bug. Only some kinds of corruption could be detected by application-level checksums. If the OS or storage subsystem just failed to write a page, Pg wouldn't be able to tell, for example. Checksums _would_ detect split page writes, single-bit faults, corrupted disk sectors and the like and could potentially be useful.
Like most forms of fault behaviour, it is undefined in the "C standard" sense of the meaning, though perhaps not quite as willing to just eat data ;-) -- Craig Ringer |