Jeremy Chadwick wrote:
The RAID card itself may have a BBU, so during loss of power any cached data *on the card* will be attempt to be flushed to disk... except the PC (including hard disks -- unless they're powered from some other source) is already down/offline by this point. And let's not forget that the OS/kernel is also gone, which means any writes which were sitting in cached memory in the kernel are lost as well.
For some reason people think that a H/W RAID card with a BBU guarantees data integrity (keyword: guarantees). I'm still trying to understand why people think that.
Pending writes in the BBU-backed RAM will be completed when the machine reboots. The assumption is that the machine will be rebooted within a few hours, before the battery runs down. Given that limitation, data in BBU-backed cache can be regarded as committed to permanent (or more accurately: /persistent/) storage. Data in OS-level caches will be lost, yes. But this is the point of softupdates. It reorders the instructions for writing data/metadata to disk so that the data on disk remains consistent -- you may loose some data in transit, but your disk contents will still be consistent. Journalling achieves a similar effect in a different way -- recording a changelog onto non-volatile storage which can later be played out to bring the stored data into the correct state, However, given that any access to rotating magnetic media is going to take about 1000x longer than access to main RAM, there's always going to be uncommitted filesystem changes in RAM that will be lost if the machine suddenly looses power or otherwise fails. Until there is a persistent storage medium with something like the timing characteristicsof RAM, that effect is simply unavoidable. The only strategy you can employ is to provide uninterruptible power supplies, and choose hardware and OS wisely, so that unexpected system failures are minimized. Sometimes you can benefit from having multiple machines and multiple copies of your data, but this is not always possible.
Cheers, Matthew -- Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard Flat 3 PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate Kent, CT11 9PW
Description: OpenPGP digital signature