Skip to contentSkip to conversation

the " 'official' point of view" expressed by kernelnewbies.org

DISCUSSION Tom Reinhart 7 participants 15 messages Aug 15, 2006 – Aug 24, 2006

lore
Share & tools
lore
#0 lore raw

Anyone with serious need for data integrity already uses RAID, so why add brand new complexity for a solved problem?

RAID is great at recovering data, but not detecting errors. File system can detect errors with checksum. What is missing is an API between layers for filesystem to say "this sector is bad, go rebuild it."

This seems like a much more simple and useful thing than adding ECC into the filesystem itself.

Quoted 6 lines
Quoted 6 lines
Quoted 2 lines

How about we switch to ecc, which would help with bit rot not sector loss?

Interesting aspect.

Quoted 7 lines
Quoted 7 lines

Yes, we can implement ECC as a special crypto transform that inflates data. As I mentioned earlier, it is possible via translation of key offsets with scale factor > 1.

Of course, it is better then nothing, but anyway meta-data remains ecc-unprotected, and, hence, robustness is not increased..

_________________________________________________________________
On the road to retirement? Check out MSN Life Events for advice on how to get there! http://lifeevents.msn.com/category.aspx?cid=Retirement

#1 lore raw
Quoted 6 lines · Tom Reinhart

Anyone with serious need for data integrity already uses RAID, so why add brand new complexity for a solved problem?

RAID is great at recovering data, but not detecting errors. File system can detect errors with checksum. What is missing is an API between layers for filesystem to say "this sector is bad, go rebuild it."

I agree that such an API is needed. I think there are a lot of systems on desktops that lack RAID though. Probably I should leave ECC for some "hopefully next year" future release though.

Quoted 25 lines

This seems like a much more simple and useful thing than adding ECC into the filesystem itself.

Quoted 6 lines
Quoted 6 lines
Quoted 2 lines

How about we switch to ecc, which would help with bit rot not sector loss?

Interesting aspect.

Quoted 7 lines
Quoted 7 lines

Yes, we can implement ECC as a special crypto transform that inflates data. As I mentioned earlier, it is possible via translation of key offsets with scale factor > 1.

Of course, it is better then nothing, but anyway meta-data remains ecc-unprotected, and, hence, robustness is not increased..

_________________________________________________________________
On the road to retirement? Check out MSN Life Events for advice on how to get there! http://lifeevents.msn.com/category.aspx?cid=Retirement

#2 lore raw
In reply to Tom Reinhart
Quoted 4 lines · Tom Reinhart

Anyone with serious need for data integrity already uses RAID, so why add brand new complexity for a solved problem?

RAID is great at recovering data, but not detecting errors. File system can detect errors with checksum. What is missing is an API between layers for filesystem to say "this sector is bad, go rebuild it."

Actually we dont need a special API: kernel should warn and recommend running fsck, which scans the whole tree and handles blocks with bad checksums.

Quoted 1 line

This seems like a much more simple and useful thing than adding ECC into the filesystem itself.

checksumming is _not_ much more easy then ecc-ing from implementation standpoint, however it would be nice, if some part of errors will get fixed without massive surgery performed by fsck

Quoted 22 lines
Quoted 9 lines
Quoted 9 lines
Quoted 4 lines

How about we switch to ecc, which would help with bit rot not sector loss?

Interesting aspect.

Quoted 7 lines
Quoted 7 lines

Yes, we can implement ECC as a special crypto transform that inflates data. As I mentioned earlier, it is possible via translation of key offsets with scale factor > 1.

Of course, it is better then nothing, but anyway meta-data remains ecc-unprotected, and, hence, robustness is not increased..

_________________________________________________________________
On the road to retirement? Check out MSN Life Events for advice on how to get there! http://lifeevents.msn.com/category.aspx?cid=Retirement

#3 lore raw
Quoted 10 lines · Edward Shishkin
Quoted 8 lines · Tom Reinhart

Anyone with serious need for data integrity already uses RAID, so why add brand new complexity for a solved problem?

RAID is great at recovering data, but not detecting errors. File system can detect errors with checksum. What is missing is an API between layers for filesystem to say "this sector is bad, go rebuild it."

Quoted 3 lines

Actually we dont need a special API: kernel should warn and recommend running fsck, which scans the whole tree and handles blocks with bad checksums.

Yes, but our fsck knows nothing about RAID currently so....

Quoted 35 lines
Quoted 3 lines

This seems like a much more simple and useful thing than adding ECC into the filesystem itself.

checksumming is _not_ much more easy then ecc-ing from implementation standpoint, however it would be nice, if some part of errors will get fixed without massive surgery performed by fsck

Quoted 23 lines
Quoted 9 lines
Quoted 9 lines
Quoted 4 lines

How about we switch to ecc, which would help with bit rot not sector loss?

Interesting aspect.

Quoted 7 lines
Quoted 7 lines

Yes, we can implement ECC as a special crypto transform that inflates data. As I mentioned earlier, it is possible via translation of key offsets with scale factor > 1.

Of course, it is better then nothing, but anyway meta-data remains ecc-unprotected, and, hence, robustness is not increased..

_________________________________________________________________
On the road to retirement? Check out MSN Life Events for advice on how to get there! http://lifeevents.msn.com/category.aspx?cid=Retirement

#4 lore raw
Quoted 11 lines
Quoted 7 lines

Anyone with serious need for data integrity already uses RAID, so why add brand new complexity for a solved problem?

RAID is great at recovering data, but not detecting errors. File system can detect errors with checksum. What is missing is an API between layers for filesystem to say "this sector is bad, go rebuild it."

I agree that such an API is needed. I think there are a lot of systems on desktops that lack RAID though. Probably I should leave ECC for some "hopefully next year" future release though.

Of course, not everyone uses RAID. ECC would benefit some people in some cases... no argument there.

But as a business man, you know about targetting the right features to the right customers:

Customer 1 uses RAID. Obviously, reliability is very important to customer 1, he is willing to take the extra expense to get it. Adding another level of protection (checksumming/RAID restore) is a no brainer, especially since it adds very little overhead over what he already sacrificed to RAID.

Customer 2 doesn't use RAID. You can add all the fancy features to the filesystem you want, this customer is already vulnerable to total disk loss.
If he really cared about integrity, he would be customer 1. If he won't
pay for RAID, why would he pay for ECC? (in money or disk space overhead).

Having ECC without RAID recovery is simply targetting the wrong person.

(having both wouldn't suck. The more layers of protection, the better, although ECC would only be necessary against RAID failures, which just adds more .9's to the reliability score. But, you can also do this by adding more redundanncy disks to the array, so it's questionable if having both is even worth the development expense)

_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar – get it now! http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/

#5 lore raw
Quoted 2 lines · Tom Reinhart

Of course, not everyone uses RAID. ECC would benefit some people in some cases... no argument there.

We can use RAID mechanisms (RS erasure code) on a single disk. You could technically call it ECC, but if you do so you will confuse people. "Block level parity" would be correct.

#6 lore raw
In reply to Edward Shishkin
Quoted 9 lines · Edward Shishkin
Quoted 4 lines · Tom Reinhart

Anyone with serious need for data integrity already uses RAID, so why add brand new complexity for a solved problem?

RAID is great at recovering data, but not detecting errors. File system can detect errors with checksum. What is missing is an API between layers for filesystem to say "this sector is bad, go rebuild it."

Actually we dont need a special API: kernel should warn and recommend running fsck, which scans the whole tree and handles blocks with bad checksums.

What does this have to do with RAID, though?

#7 lore raw
Quoted 9 lines · David Masover
Quoted 7 lines · Edward Shishkin
Quoted 4 lines · Tom Reinhart

Anyone with serious need for data integrity already uses RAID, so why add brand new complexity for a solved problem?

RAID is great at recovering data, but not detecting errors. File system can detect errors with checksum. What is missing is an API between layers for filesystem to say "this sector is bad, go rebuild it."

Quoted 8 lines
Quoted 3 lines

Actually we dont need a special API: kernel should warn and recommend running fsck, which scans the whole tree and handles blocks with bad checksums.

What does this have to do with RAID, though?

I assumed we dont have raid: reiser4 can support its own checksums/ecc signatures for (meta)data protection via node plugin

#8 lore raw
Quoted 15 lines · Edward Shishkin
Quoted 14 lines · David Masover
Quoted 10 lines · Edward Shishkin
Quoted 4 lines · Tom Reinhart

Anyone with serious need for data integrity already uses RAID, so why add brand new complexity for a solved problem?

RAID is great at recovering data, but not detecting errors. File system can detect errors with checksum. What is missing is an API between layers for filesystem to say "this sector is bad, go rebuild it."

Actually we dont need a special API: kernel should warn and recommend running fsck, which scans the whole tree and handles blocks with bad checksums.

Quoted 6 lines
Quoted 3 lines

What does this have to do with RAID, though?

I assumed we dont have raid: reiser4 can support its own checksums/ecc signatures for (meta)data protection via node plugin

We don't have a guaranteed raid, however, it would be nice to do the right thing when there is raid.

#9 lore raw
In reply to Edward Shishkin
Quoted 3 lines · Edward Shishkin

checksumming is _not_ much more easy then ecc-ing from implementation standpoint, however it would be nice, if some part of errors will get fixed without massive surgery performed by fsck

We need checksumming even with eccing... ECCing on large spans of data is too computationally costly to do unless we know something is wrong (via a checksum).

Lets pause for a minute, when you talk about ECC what are you actually
talking about? If you're talking about a hamming code (used on ram,
http://en.wikipedia.org/wiki/Hamming_code) or Convolutional code (used on telecom links, http://en.wikipedia.org/wiki/Convolutional_code) or are you talking about an erasure code like RS coding
(http://en.wikipedia.org/wiki/Reed-Solomon_code)?

I assume in the discussions that you're not talking about an RS like code... because RAID-5 and RAID-6 are, fundamentally, a form of RS coding. They don't solve bit errors, but when you know you've lost a block of data they can recover it.

Non-RS forms of ECC are very slow in software (esp decoding) .. and really aren't that useful: most of the time HDD's will lose data in nice big chunks that erasure codes handle well but other codes do not.

The challenge with erasure codes is that you must know that a block is bad... most of the times the drives will tell you, but some times corruption leaks through. This is where block level checksums come into play... they allow you to detect bad blocks and then your erasure
code allows you to recover the data. The checksum must be fast
because you must perform it on every read from disk... this makes ECC unsuitable, because although it could detect errors, it is too slow. Also, the number of additional errors ECC could fix are very small.. It would simply be better to store more erasure code blocks.

An optimal RS codes which allows one block of N to fail (and require one block extra storage) is computationally trivial. We call it raid-5. If your 'threat model' is bad sectors rather than bad disks (an increasingly realistic shift) then N needs to have nothing to do with the number of disks you have and can be instead related to how much protection you want on a file.

If 1:N isn't enough for you, RS can be generalized to any number of redundant blocks. Unfortunately, doing so requires modular aritmetic which current CPUs are not too impressively fast at. However, the Linux Raid-6 code demonstrates that two part parity can be done quite quickly in software.

As such, I think 'ecc' is useless.. checksums are useful because they are cheap and allow us to use cheap erasure coding (which could be in a lower levle raid driver, or implemented in the FS) to achieve data integrity.

The question of including error coding in the FS or in a lower level is, as far as I'm concerned, so clear a matter that it is hardly worth discussing anymore. In my view it is absolutely idiotic to place redundancy in a lower level.

The advantage of placing redundancy in a lower level is code simplicity and sharing.

The problem with doing so, however, is many fold.

The redundancy requirements for various parts of the file system differ dramatically, without tight FS integration matching the need to the service is nearly impossible.

The most important reason, however, is performance. Raid-5 (and raid-6) suffer a tremendous performance hit because of the requirement to write a full stripe OR execute a read modify write cycle. With FS integrated erasure codes it is possible to adjust the layout of the written blocks to ensure that every write is a full stripe write, effectively you adjust the stripe width with every write to ensure that the write always spans all the disks. Alternatively you can reduce the number of stripe chunks (i.e. number of disks) in the parity computation to make the write fit (although doing so wastes space)...

FS redundancy integration also solves the layout problem. From my experience most systems with hardware raid are getting far below optimal performance because even when their FS is smart enough to do file allocation in a raid aware way (XFS and to a lesser extent EXT2/3) this is usually foiled by the partition table at the beginning of the raid device. Resulting in 1:N FS blocks actually spanning two disks! (thus reading that block incurres potentially 2x disk latency).

Seperated FS and redundancy layers are an antiquated concept.. The FS's job is to provide reliable storage, fully stop. It's shocking to see that a dinosaur like SUN has figured this out but the free software community still fights against it.

#10 lore raw

I am skeptical that bitflip errors above the storage layer are as common as the ZFS authors say, and their statistics that I have seen somehow lack a lot of detail about how they were gathered. If, say, a device with 100 errors counts as 100 instances for their statistics..... Well, it would be nice to know how they were gathered. Next time I meet them I must ask.

That said, if users want it, there should be a plugin that checks the bits.

I agree that stripe awareness and the need to signal the underlying raid that a block needs to be recovered is important. Checksumming at the fs level seems like a reasonable plugin.

I have no opinion on the computational cost of ECC vs. checksums, I will trust that you are correct.

#11 lore raw
Quoted 7 lines · Hans Reiser

I am skeptical that bitflip errors above the storage layer are as common as the ZFS authors say, and their statistics that I have seen somehow lack a lot of detail about how they were gathered. If, say, a device with 100 errors counts as 100 instances for their statistics..... Well, it would be nice to know how they were gathered. Next time I meet them I must ask.

I think that most big vendors have a lot of information about failure rates on drives, but cannot actually share the details in public (due to NDA's with the suppliers).

One thing that we are trying to do is to get some of the more "community" oriented people at Seagate Research to come out and talk to the people about what are reasonable types of errors to code against. Current idea is to get everyone in the same place a couple of days before the next FAST conference (i.e., linux IO people or file system people and these vendors). (See the USENIX page for details on FAST at http://www.usenix.org/events/fast07/cfp/).

I will say that media errors tend to be larger than single bit errors, i.e. you will lose a set of sectors instead of seeing a single bit flip on one sector (remember that the drive vendors do extensive ECC at their level). What their ECC will not fix is something like junk settling on the platter or a really bad error like a bad disk head.

Quoted 9 lines

That said, if users want it, there should be a plugin that checks the bits.

I agree that stripe awareness and the need to signal the underlying raid that a block needs to be recovered is important. Checksumming at the fs level seems like a reasonable plugin.

I have no opinion on the computational cost of ECC vs. checksums, I will trust that you are correct.

What we can (and should) do is to make sure that we detect errors much better than we do today. I think that ECC would be overkill, but we certainly could do simple checksums for strategic parts of the file system data.

Also note that there is work underway in the SCSI space on something called "block guard" that defines some extra bytes per disk sector for application level data. That could be used for per block sanity checking information, but how to get at it from the file system is an interesting question.

Val's write up at LWN on the file system workshop & the comments on that write up has a an active discussion on this kind of thing (http://lwn.net/Articles/190222/).

ric

#12 lore raw
Quoted 20 lines · Ric Wheeler
Quoted 7 lines · Hans Reiser

I am skeptical that bitflip errors above the storage layer are as common as the ZFS authors say, and their statistics that I have seen somehow lack a lot of detail about how they were gathered. If, say, a device with 100 errors counts as 100 instances for their statistics..... Well, it would be nice to know how they were gathered. Next time I meet them I must ask.

I think that most big vendors have a lot of information about failure rates on drives, but cannot actually share the details in public (due to NDA's with the suppliers).

One thing that we are trying to do is to get some of the more "community" oriented people at Seagate Research to come out and talk to the people about what are reasonable types of errors to code against. Current idea is to get everyone in the same place a couple of days before the next FAST conference (i.e., linux IO people or file system people and these vendors). (See the USENIX page for details on FAST at http://www.usenix.org/events/fast07/cfp/).

Quoted 5 lines

I will say that media errors tend to be larger than single bit errors, i.e. you will lose a set of sectors instead of seeing a single bit flip on one sector (remember that the drive vendors do extensive ECC at their level). What their ECC will not fix is something like junk settling on the platter or a really bad error like a bad disk head.

I think that integration of fs, fsck, and raid is the right solution for media errors. What I haven't seen data I trust on is what is bitflip error rate for the non-media sources. Since I haven't seen data I believe (where belief requires details being supplied), my inclination is to say plugins that users can choose to use if they want them are the right solution.

Quoted 1 line

I think that ECC would be overkill,

I view it as an option that we make available to enterprise customers who want to feel good.

It is not for me to tell them that they are wrong, for I lack the data, it is merely for me to supply it as a non-default option, and let the users tell me how often it actually gets triggered when they use it.

#13 lore raw
In reply to Gregory Maxwell
Quoted 5 lines

Seperated FS and redundancy layers are an antiquated concept.. The FS's job is to provide reliable storage, fully stop. It's shocking to see that a dinosaur like SUN has figured this out but the free software community still fights against it.

I so totally agree.

Some random points :

- Modern harddisks use elaborate error correction schemes, so when a
sector has an uncorrectable error, it won't be a bit flip, but rather something akin to a full sector worth of random bits, or at least enough wrong bits that the sector is pretty useless.

- RAID could be used to detect errors, but it would be quite slow to do
this, as all mirrors or parity disks would have to be read and checked for equality / zero XOR sum on each read. It is a lot more interesting performance-wise to send reads in parallel to all disks.

- Checksums are needed to catch silent errors. The checksum needs to be
long enough and strong enough (ie. not a 32 bit CRC).

- The ZFS approach of integrating FS, redundancy and checks seems good to
me, because there needs to be some communication between the FS and the redundancy layer : re-reading bad blocks and especially making all writes full stripe.

- Harddisks are cheap. Would it be possible to store the FS log on a disk
and the FS data itself on another disk ? The log disk would only hit sequential writes ; the data disk would sync as seldom as possible. Both "disks" could be raid mirrors pairs ; or the log disk could be solid-state in a few years when a version of the ram harddisk with ECC and decent bandwidth appears.

#14 lore raw
In reply to Edward Shishkin
Quoted 6 lines

From: Edward Shishkin <[email protected]>

Actually we dont need a special API: kernel should warn and recommend running fsck, which scans the whole tree and handles blocks with bad checksums.

Running fsck requires taking filesystem offline and having downtime. No fun. :(

Correcting individual data errors can be done quickly and on-line as long as there exists a subset of the RAID that can reconstruct the correct data (with the correct checksum).

_________________________________________________________________
Don’t just search. Find. Check out the new MSN Search! http://search.msn.click-url.com/go/onm00200636ave/direct/01/