Monday, September 14, 2009

Zpool recovery support (PSARC/2009/479)

Last winter there was a flood of mail on zfs-discuss ignited by this. The user had lost his pool that was residing on a USB device. The used had abused ZFS and pulled the disks without exporting the pool, but the pool should still be usable since ZFS claims to have a always consistent on-disk format. To make a long story short, ZFS base for its consistent disk format is that write-flush is honored when doing the atomic operation of updating the überblock. If the hardware lies about the success of this operation and the disk(s) are disconnected or a power failure occurs the pool can be left in an inconsistent state. This typically only happens with cheaper customer grade hardware like USB-disk, but nevertheless this kind of hardware is used, and remember ZFS loves cheep disk ;)

In the the end Jeff Bonwick himself came in and stated that this was something he was working on, and it seems like this work is finally making its way towards Opensolaris with PSARC 2009/479 being discussed at this weeks ARC meeting (BugID 6667683). This change will make it possible to revert back to the last TXG if the pool is in a inconsistent state by using the new "-F" flag to zpool. I've myself never encountered this problem, but it's always good to have options to recover if something goes wrong. This is probably not an issue for people using ZFS in the enterprise, but if you are out of luck and are using a USB stick/driver for storing your zpool, this might come in handy.

No comments: