HAMMER 25/many: Pruning code
authorMatthew Dillon <dillon@dragonflybsd.org>
Tue, 5 Feb 2008 07:58:43 +0000 (07:58 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Tue, 5 Feb 2008 07:58:43 +0000 (07:58 +0000)
commit32c90105bec38cf3ca15d5f66aa481edd792a49c
tree77c7110b1c41a30478efd869b2fe13c8dbde3515
parent9380c752cf85eb3c007452a7edc2e53b301f4876
HAMMER 25/many: Pruning code

* Add b_tid to struct buf so dirty buffer cache buffers can be tagged with
  a transaction id to try to retain consistency when doing as-of queries
  on files that change size (so the data records have a TID <= the inode
  record).  This is also an issue when a file is created and immediately
  written to.  This may be temporary, a more sophisticated solution is needed.

* Fix a bug in the special handling of create_tid for as-of queries
  in btree_search().  An assignment was off by one, causing historical
  queries to not be able to find bits of data here and there.

* Freeze the transaction id for newly created inodes until the initial
  inode record is laid down on disk, so the transaction id matches the
  transaction id of the related directory entry.

* Major work on the pruning code.   When pruning the tree to a particular
  granularity the create_tid and delete_tid of related records must be
  aligned to that granularity in order to avoid creating 'holes' at
  various time points.

  This requires some serious B-Tree manipulation because the right-hand
  boundary may need to be shifted when the create_tid of an existing
  record is forward aligned.  This work is still in progress but it works
  in basic testing.

  Prune the tree in the reverse direction instead of in the forward
  direction.  This keeps the B-Tree consistent when we have to adjust
  the right-hand boundary to accomodate the realignment of create_tid.
sbin/hammer/cmd_prune.c
sbin/hammer/misc.c
sys/sys/buf.h
sys/vfs/hammer/hammer.h
sys/vfs/hammer/hammer_btree.c
sys/vfs/hammer/hammer_cursor.c
sys/vfs/hammer/hammer_inode.c
sys/vfs/hammer/hammer_ioctl.c
sys/vfs/hammer/hammer_ioctl.h
sys/vfs/hammer/hammer_object.c
sys/vfs/hammer/hammer_vnops.c