HAMMER VFS - Use full-block undos for B-Tree nodes
authorMatthew Dillon <dillon@apollo.backplane.com>
Sat, 13 Oct 2012 17:03:03 +0000 (10:03 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Sat, 13 Oct 2012 17:03:03 +0000 (10:03 -0700)
commit283a4a38e8d7fa8c794b0ef735303cf8c28ced79
tree4f1df1ad15b0906d725e46b1a2451270418cfed6
parentbab94315b491ac350b4405a1bf3b606e5fb47f1e
HAMMER VFS - Use full-block undos for B-Tree nodes

* Use a full-block undos instead of small byte-range undos for
  B-Tree nodes.

  There is no bug here per-say, but we are trying to improve
  HAMMER's ability to recover after a power failure where a disk
  drive is writing to the platter at the time of the failure.
  While we have no control over any unrelated sectors that might
  get smashed by such an event, the concern is that sectors being
  specifically written might get corrupted beyond the ability for
  the byte-range undo to fix.

  The reason is that if, say, only 50 bytes in a B-Tree node need
  updating, HAMMER must still do a 16K physical write to disk, so
  really any portion of that 16K can wind up corrupt on a power
  failure, not just the 50 bytes being changed.

  So instead of writing a byte-ranged 50-byte UNDO we now write
  a 16K undo for B-Tree elements.

* The hope is that this will improve cases where HAMMER has become
  unmountable due to CRC errors in the B-Tree closer to the root of
  the B-Tree (which are usually updated to update only the mirror_tid)

Reported-by: sgeorge, marino
sys/vfs/hammer/hammer.h
sys/vfs/hammer/hammer_vfsops.c