HAMMER 20A/many: B-Tree lookup API cleanup, B-Tree changes.
authorMatthew Dillon <dillon@dragonflybsd.org>
Wed, 16 Jan 2008 01:15:37 +0000 (01:15 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Wed, 16 Jan 2008 01:15:37 +0000 (01:15 +0000)
commitd5530d2232f43e035c8430696aea532e8d82e185
tree2640ba08f4ece8b6ea4c6ce053a888682e51ea40
parent26681b7f9039724104b8884eb29c97fdd9573973
HAMMER 20A/many: B-Tree lookup API cleanup, B-Tree changes.

* Abstract the as-of TID in the cursor API to hide the implementation
  details.

* Key off of delete_tid instead of create_tid.

* Deal with a boundary key issue related to as-of lookups.  This issue arises
  when several records which differ only by their create_tid/delete_tid
  reside in different leaf nodes.  For example:

o(10) (delete_tid's listed)
       /    \
      6     16

  If we want to do an as-of lookup of say, (8), the btree scan will dive
  into the left branch and fail to find any elements visible to our as-of
  request.  The element '16' in the right branch, however, is visible
  because it was deleted after the as-of timestamp of 8.

  When this case arises btree_search() now detects that the boundary
  element (10) exactly matches the request except for the delete_tid
  and btree_search() now automatically iterates if an as-of search
  is being executed.

  For non-asof searches, such as insertion searches, the delete_tid is
  treated as an absolute and it is desireable to recurse into the left
  branch and stop there.  If we popped over to the right branch our
  new element (8) would be to the right of our boundary element (10)
  instead of to the left.

* Remove code related to dealing with spike ranges in preparation for
  a major change in the way spikes operate.
sys/vfs/hammer/hammer_btree.c
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_vnops.c