hammer2 - Stabilization
authorMatthew Dillon <dillon@apollo.backplane.com>
Fri, 15 Nov 2013 08:21:23 +0000 (00:21 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Fri, 15 Nov 2013 08:21:23 +0000 (00:21 -0800)
commit623d43d4bac0d56862c31c924389cd6db3c35114
treee985a84005c6ecb52882c7155828aa75efc4bb9a
parent2258af1d76cf6db5eefdac63588d1ad2dd6e6005
hammer2 - Stabilization

Yet more stabilization.  Generally speaking the code is starting to look
pretty good, but finding the corner cases for the in-memory chain state
has taken more time than I had hoped.  All of this complexity exists solely
in order to allow flushes to run concurrently with modifying operations by
the front-end (which is a pretty significant performance feature).

* Fix a bug in the hammer2_chain_get() race detection code.

* Refactor hammer2_freemap_alloc() a bit.

* Save debug info in dead block array fields (temporary), and add some
  debugging field to the chain structure.

* Refactor the flush code that checks whether a deleted chain should be
  ignored or not, fixing a bug at the same time.

* Refactor the transaction sequencing.  Flushes now allocate an extra
  transaction id so a distinction can be made between chains whos block
  arrays have not been updated and chains whos block arrays have been
  updated.

* Refactor the MOVED flag removal algorithm a little, fixing a bug or two.

* Adjust the freemap to detect forked chains and ensure that a different
  reserved block is calculated for the two possible forks.

* Fix a few mount fail cases that were panicing.

* Update bref.mirror_tid in scan1 skip cases.

* Do not update bref.mirror_tid in the skip case as this can confuse
  how a child's block array is interpreted in a future flush.

* Augment chain code with maxloops counters for debugging infinite
  loops.

* Remove the CHAIN_DUPLICATED tests in hammer2_chain_find() as this can
  catch a delete-duplicate in-progress and incorrectly cause the search
  to fail.

* Remove looping on CHAIN_DUPLICATED detection.  Instead what we do now
  is lock the chain before testing the CHAIN_DELETED bit.  Locking the
  chain will resolve delete-duplicate races and place the chain in a
  deterministic state.  The CHAIN_DELETED test is then sufficient.
sys/vfs/hammer2/TODO
sys/vfs/hammer2/hammer2.h
sys/vfs/hammer2/hammer2_chain.c
sys/vfs/hammer2/hammer2_disk.h
sys/vfs/hammer2/hammer2_flush.c
sys/vfs/hammer2/hammer2_freemap.c
sys/vfs/hammer2/hammer2_vfsops.c
sys/vfs/hammer2/hammer2_vnops.c