HAMMER 22/many: Recovery and B-Tree work.
authorMatthew Dillon <dillon@dragonflybsd.org>
Mon, 21 Jan 2008 00:00:19 +0000 (00:00 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Mon, 21 Jan 2008 00:00:19 +0000 (00:00 +0000)
commiteaeff70d7ec4b8944e1f94deb49549af6377482c
tree63327232b77b91f05b3666c5c62676b0efff8768
parent0ada940de01275ab889bf98d3bb930ee7cb8afe1
HAMMER 22/many: Recovery and B-Tree work.

* More work on the recovery code.  Interlock cluster header loading with
  the recovery operation and fix numerous bugs.

* Move some of the complexity of an AS-OF B-Tree lookup out of btree_search()
  and into btree_lookup().  Now btree_search() can just fail normally and
  btree_lookup() checks for the edge case.  The situation that occurs is
  this:
  10     15       20
      |       |
    LEAF1    LEAF2
   (12)          (18)

  If the boundary only differs by the delete_tid element, and we are doing
  a lookup AS-OF timestamp 14, we will traverse into LEAF1 which contains
  no visible nodes (element @ timestamp 12 has been deleted as-of 14).
  btree_lookup() now checks for the edge case and iterates the search
  to locate the visible element (18) in LEAF2.

  It's a bit more complex then that, but that's the basic issue.

* Fix a leaf-splitting case due to the new spike topology.

* Change the spike's ending element to be range-exclusive instead of range-
  inclusive, matching all other end-range keys in HAMMER.  Adjust the B-Tree
  code to handle the case.

* Normalize debugging output into the volume:cluster:node_offset form
  that the 'hammer show' utility uses.
13 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_btree.h
sys/vfs/hammer/hammer_cursor.h
sys/vfs/hammer/hammer_disk.h
sys/vfs/hammer/hammer_inode.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_transaction.c