HAMMER 23/many: Recovery, B-Tree, spike, I/O work.
authorMatthew Dillon <dillon@dragonflybsd.org>
Thu, 24 Jan 2008 02:14:45 +0000 (02:14 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Thu, 24 Jan 2008 02:14:45 +0000 (02:14 +0000)
commitb33e2cc0e9dcf4c0c119525e7b9e8c298199e0b5
tree074c82dfc95ce0f2fe107e591d2fe59aff15fd67
parent6e3afccdf12ddb0c979c307351c8b0988696664b
HAMMER 23/many: Recovery, B-Tree, spike, I/O work.

Warning: filesystem structures have changed, recompile newfs_hammer too.

* Correct a couple more edge cases with historical lookups.  We have to
  flag the need for an iteration anywhere the edge case is hit as we
  recurse down, not just on the terminal B-Tree node.

* Get rid of the kludge record buffer bitmap in the cluster header.  Augment
  the A-List recovery and scanning code to locate record buffers.   This
  required adding some unfortunate complexity to the A-list search and
  recovery routines due to the fact that we ran out of bit codes and
  couldn't represent an all-free/initialized AND an all-free/uninitialized
  case.

* Go back to making the SPIKE_END elements range-inclusive instead of
  range-exclusive.  It turns out that making them range-exclusive caused
  a few too many collisions with adjacent records in the B-Tree.

* Excellent progress on the recovery code.  It still has numerous issues
  (there are lots of recovery cases I still have to implement), but
  it survives much longer now.  Add a sysctl to disable/enable/force
  cluster recovery (default disabled, since its still buggy).

* When creating a spike be sure to properly assign the cluster record's
  rec_offset.

* When removing a spike be sure to also free the related cluster record.

* Spike code progress.  Implement the last case it couldn't handle (spiking
  a spike) and add a very simple starter heuristic which generates a
  better spike topology (doesn't create long chains of end-range spikes).

* Add a huge number of new assertions to ease the tracking down of bugs.

* Address some IO sequencing issues that could result in io.modified
  getting prematurely cleared.  io.modified can only be cleared on write
  initiation on the last ref to a HAMMER structure.

* Add a hack to pre-reserve enough B-Tree buffers to guarantee the recovery
  code can regenerate the B-Tree without having to pack it.  This ultimately
  needs to be fixed (the recovery code really needs to pack the tree).
14 files changed:
sys/vfs/hammer/hammer.h
sys/vfs/hammer/hammer_alist.c
sys/vfs/hammer/hammer_alist.h
sys/vfs/hammer/hammer_btree.c
sys/vfs/hammer/hammer_cursor.c
sys/vfs/hammer/hammer_cursor.h
sys/vfs/hammer/hammer_disk.h
sys/vfs/hammer/hammer_inode.c
sys/vfs/hammer/hammer_io.c
sys/vfs/hammer/hammer_object.c
sys/vfs/hammer/hammer_ondisk.c
sys/vfs/hammer/hammer_recover.c
sys/vfs/hammer/hammer_spike.c
sys/vfs/hammer/hammer_vfsops.c