-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I see, thank you for the clarification. So it is possible to have something equivalent to main storage self-healing on ZIL, with ZIL-scrub to activate it. Or is that already implemented also? (Sorry for asking these obvious questions, but I'm not familiar with ZFS source code.)
- -- Saso On 08/26/2010 04:31 PM, Darren J Moffat wrote: > On 26/08/2010 15:08, Saso Kiselkov wrote: >> If I might add my $0.02: it appears that the ZIL is implemented as a >> kind of circular log buffer. As I understand it, when a corrupt checksum > > It is NOT circular since that implies limited number of entries that get > overwritten. > >> is detected, it is taken to be the end of the log, but this kind of >> defeats the checksum's original purpose, which is to detect device >> failure. Thus we would first need to change this behavior to only be >> used for failure detection. This leaves the question of how to detect >> the end of the log, which I think could be done by using a monotonously >> incrementing counter on the ZIL entries. Once we find an entry where the >> counter != n+1, then we know that the block is the last one in the >> sequence. > > See the comment part way down zil_read_log_block about how we do > something pretty much like that for checking the chain of log blocks: > > http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/uts/common/fs/zfs/zil.c#zil_read_log_block > > > This is the checksum in the BP checksum field. > > But before we even got there we checked the ZILOG2 checksum as part of > doing the zio (in zio_checksum_verify() stage): > > http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/uts/common/fs/zfs/zio_checksum.c#zio_checksum_error > > > A ZILOG2 checksum is a embedded in the block (at the start, the > original ZILOG was at the end) version of fletcher4. If that failed - > ie the block was corrupt we would have returned an error back through > the dsl_read() of the log block. > -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkx2f64ACgkQRO8UcfzpOHA7rACgoyydAq2hO/VIfdknRb09WWGJ BkwAn2i3nPtWNnfXwyW2089YMb8FRkZP =YMqL -----END PGP SIGNATURE----- _______________________________________________ zfs-discuss mailing list zfs-discuss@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/zfs-discuss