DragonFly commits List (threaded) for 2009-11
git: HAMMER VFS - Version 4 part 1/many - UNDO FIFO layout work.
Author: Matthew Dillon <email@example.com>
Date: Sun Nov 1 16:35:41 2009 -0800
HAMMER VFS - Version 4 part 1/many - UNDO FIFO layout work.
These changes only apply to HAMMER version 4+ filesystems. HAMMER
versions less then 4 only implement some of these changes and do not
use the new features during crash recovery.
* Add a sequence number of the UNDO FIFO media record format. The field
already existed for just this purpose so no media structures changed
* Change the alignment boundary for HAMMER UNDO records from 16K to 512
bytes. This coupled with the sequence number virtually guarantees that
the recovery code can detect uninterrupted sequences of UNDO records
without having to relay on the FIFO last_offset field in the volume
This isn't as bad as it sounds. It just means that large UNDO blocks
are broken up into smaller on-media structures in order to ensure a
record header occurs on every 512 byte boundary.
* Add HAMMER_HEAD_TYPE_DUMMY and HAMMER_HEAD_TYPE_REDO (Redo is not yet
used). The DUMMY type is a dummy record used solely to identify a
sequence number. PAD records cannot have sequence numbers so we need
a DUMMY record for it.
Remove unused UNDO FIFO record types.
* Adjust the version upgrade code to completely reinitialize the UNDO FIFO
space when moving from version < 4 to version >= 4. This puts all blocks
in the UNDO FIFO in a deterministic state with deterministic sequence
numbers on 512 byte boundaries.
* Refactor the flush code. In versions less then 4 the flush code had to
flush dirty UNDO buffers, synchronize disk, then flush the volume header
and synchronize disk again, then flush the meta data. For HAMMER
versions >= 4 the flush code removes the second disk synchronization
* Refactor the crash recovery code. For versions < 4 the crash recovery
code relied on the UNDO FIFO first_offset and next_offset indexes in
the volume header to calculate the UNDO space that needed to be run.
For versions >= 4 the crash recovery code uses first_offset for the
beginning of the UNDO space and proactively scans the UNDO FIFO to
find the end of the space. This takes longer but allows HAMMER to
remove one of the two disk sync operations in the flush code.
* Split the crash recovery code into stage 1 and stage 2. Stage 2 will
be used to run REDO operations (REDO is not yet implemented).
Summary of changes:
sys/vfs/hammer/hammer.h | 7 +-
sys/vfs/hammer/hammer_disk.h | 67 +++-
sys/vfs/hammer/hammer_flusher.c | 36 ++-
sys/vfs/hammer/hammer_io.c | 4 +-
sys/vfs/hammer/hammer_ioctl.c | 43 ++-
sys/vfs/hammer/hammer_mount.h | 2 +
sys/vfs/hammer/hammer_recover.c | 723 ++++++++++++++++++++++++++++++---------
sys/vfs/hammer/hammer_undo.c | 372 ++++++++++++++++----
sys/vfs/hammer/hammer_vfsops.c | 13 +-
9 files changed, 1004 insertions(+), 263 deletions(-)
DragonFly BSD source repository