Sorry for the spam - this is my last post before your next response.
My best understanding is that within your RAID1C, Fletcher could work as
a "CRC32 on steroids", because it would not only detect error when
reading sectors/blocks that are broken because they contain
inadvertently moved data, but also it would detect error when reading
sectors/blocks where the write *did not go through*.
In such a case, perhaps a disk mirror, or your self-healing area, could
help figure out what should actually be on that provenly incorrect
sector.
This is awesome as it cements fread() integrity guarantees.
The price it comes at, I guess, is a slight overhead (which is that the
upper branches in the tree need to be updated), and also perhaps if
there's a power failure that leaves the hash tree corrupt, correcting it
would be pretty nasty - but that may be the whole point with it, that
you're in a place where there always are backups and you just want to
maximize the read correctness guarantees.
For anything important I'd easily prefer to use that.
On 2015-12-02 03:40, Tinker wrote:
Just to illustrate the case. This is just how I got that it works,
please pardon the amateur level on algorithm details here.
With the Fletcher checksumming, say that you have the Fletcher
checksum in a tree structure of two levels: One at the disk root, one
for every 100MB of data on the disk.
When you read any given sector on the disk, it will be checked for
consistency with those two checksums, and if there's a failure,
fread() will fail.
Example: I write to sector/block X which is at offset 125MB.
That means the root checksum and the 100MB-200MB branch checksums are
updated.
I now shut down and start my machine again, and now block/sector X
changed mapping with some random block/sector Y located at offset
1234MB.
Consequently, any fread() both of sector X and of sector Y will fail
deterministically, because both the root checksum and the 100-200MB
checksum and the 1200-1300MB checksum checks would fail.
Reading other parts of the disk would work though.
On 2015-12-02 03:31, Tinker wrote:
Hi Karel,
Glad to talk to you.
Why the extra IO expense?
About the Fletcher vs not Fletcher thing, can you please explain to me
what happens in a setup where I have one single disk with one single
RAID partition on it using your disciple, and..
1) I write a sector/block on some position X
2) My disk's allocation table gets messed up so it's moved to another
random position Y
3) I read sector/block on position Y
4) Also I read sector/block on position X