[Twg] FW: T10 End-to-End Data Integrity HLD

John Carrier carrier at cray.com
Thu Apr 12 06:54:54 UTC 2012


Reposting Andreas' reply to include discuss at lists.opensfs.org too. 

-----Original Message-----
From: twg-bounces at lists.opensfs.org [mailto:twg-bounces at lists.opensfs.org] On Behalf Of Andreas Dilger
Sent: Wednesday, April 11, 2012 11:42 PM
To: Nathan Rutman
Cc: twg at lists.opensfs.org; Andrew Perepechko
Subject: Re: [Twg] T10 End-to-End Data Integrity HLD

On 2012-04-10, at 1:53 PM, Nathan Rutman wrote:
> I'm posting our T10 HLD here for public review.  I'll be talking about this at LUG, but if you want a sneak peak or more detail, read on.

Nathan,
thanks for posting this.  I've been meaning to reply (I'm swamped with other things) but thought it important to get back to you quickly.

I think it should be possible to come to a common solution between the T10 design you presented, and the Merkle tree design that was done for HPCS a few years ago.  The only potential area of difficulty would be around the APP tags (if those are being used by the client/application at all) since they cannot be regenerated at the server.

One of the attractive features of the Merkle tree design is that it doesn't impose any extra overhead on the bulk RPC transmission, since the checksum sent with the RPC is distilled down to a single number, regardless of whether it is a single checksum on the data as is done today, or a hash of individual sector/page/chunk checksums as is proposed in both of our designs.  Similarly, this avoids the need to store long lists of GRD+REF+APP tags on large pages (which is really the smallest unit of coherency on the client), as would be needed with the straight T10-DIX implementation (128 * 8 bytes for a 64kB PAGE_SIZE with 512-byte sectors).

There is enough flexibility in the current Lustre RPC checksum wire format that both the T10 GRD+REF and the ZFS Fletcher4 checksum could be chosen as leaf checksums, and a tree hash can be used for both to get a single RPC hash, giving 2 or 3 new Lustre wire checksum formats.  Since the server side needs to recompute the checksums anyway, it can regenerated GRD tag from the data, get the REF (offset) values from the RPC niobufs, and then rehash it to compare to the RPC checksum.

Using a Merkle tree for the RPC checksum also avoids the potential problems as described in section 8.5, since the rather large amount of GRD+REF+APP tags do not actually need to be sent with the RPC, only the hash of them (currently a 32-bit value, but it could be expanded to be a 256-bit value if needed/desired).

The Merkle tree also has the added benefit that the client does not need to know the sector sizes of the OSTs and handle them separately.  Otherwise, there is either a restriction that the OSTs all have to have drives with the same sector sizes (to avoid the need for the client to compute GRD tags differently for each page in a striped file), or the llite layer will need to poke into the OSC for every page to figure out the sector size.

Since the client would always resend the whole RPC on checksum failure anyway, having a single checksum that is validated at both ends is enough for the Lustre part of the transfer.  If it compares correctly, then the GRD+REF tags must match the originals, and can be used to submit to the underlying DIF hardware (if available) and/or recomputed to match the actual sector size if it is different between OSTs.

The one issue is the APP tags.  They are arbitrary 16-bit values, but it seems for the purpose of this design that the client and MDRAID layer will be generating the APP tags internally (versions), so there is currently no need (or ability) to store userspace APP tags all the way to disk?  That would also avoid the need to pass them over the wire, since there is no chance of a torn/lost write for the RPC part of the data path.

Some other comments on the design:
6.3: the mmap issue was fixed for Lustre 2.2 by Jinshan using the
     PG_writeback/page_mkwrite() support in newer kernels.  It should
     no longer be possible for pages to change after calculating the
     checksum but before the RPC is sent.  See LU-884 for details.
8.5.2: why not compute the CRC in the correct endianness in the first
     place?  The kernel already has e.g. crc32_le() and crc32_be()
     routines, so it may also have the needed routines for T10-CRC.
     It also isn't clear whether CRC-then-swab is the same as doing
     the CRC in the other endianness in the first place?  Typically,
     RPCs are in "receiver makes right" format, which reduces overhead
     in the common case that both ends are the same.  However, if
     the underlying DIF API requires the CRC to always be big endian,
     it makes sense to swab it on the client already.

Cheers, Andreas
--
Andreas Dilger                       Whamcloud, Inc.
Principal Lustre Engineer            http://www.whamcloud.com/




_______________________________________________
twg mailing list
twg at lists.opensfs.org
http://lists.opensfs.org/listinfo.cgi/twg-opensfs.org


More information about the Twg mailing list