Skip to contentSkip to conversation

detection/correction of corruption with raid6

DISCUSSION Piergiorgio Sartor 5 participants 8 messages Dec 16, 2008 – Dec 19, 2008 1 message not in the archive MD RAID

lore
Share & tools
lore
#0 lore raw

Hi all,

while I do agree that the issue needs more in deep thinking, I would like to tell a recent story that happened to me.

I was testing a RAID-6 array, with 7, small, HDs. Intention was to get used to different situations, repair, grow, fail, remove, etc.

After some playing, I started to check the files on the array and I found out that they were not (always) correct. So I started a check of the array, which returned some 1000 or more mismatches.

After some investigation, I found out that one HD had a "flaky" interface, data was correctly written, but sometimes, randomly, reading returned some "wrong" bits (re-cabling solved the issue).

To check this with RAID-6, I could run the check with 6 disks, for 7 times, each with a different disk removed, until one run returned no mismatches.
At this point, I knew which "data path" was defective.

It would have saved a lot of time, if the check could have done this automatically...

So, my RFE, would be, if possible, to try, during RAID-6 check, to find out if and which HD has the mismatch.
Ideally, at the end of the check, the system log should show how many mismatches, if any, are likely to belong to which HD or are undetermined.
This would help to diagnose the full data path and reduce testing time in case of problems.
In case only one HD results problematic, this one could be failed, removed and the complete cabling, I/F and so on checked. Of course, this goes beyond the simple "HD failure protection" scope of RAID, nevertheless I do not see why this possibility should be neglected, unless it is too complex/difficult to implement and maintain.

Regarding the possibility of recovery, I have one question:

Why a RAID system might have inconsistencies?
Why do we have a "check" command at all, to run weekly or monthly?

Thanks,

bye,

Signature · 1 line
piergiorgio sartor
#1 lore raw
Quoted 18 lines · Piergiorgio Sartor

Hi all,

while I do agree that the issue needs more in deep thinking, I would like to tell a recent story that happened to me.

I was testing a RAID-6 array, with 7, small, HDs. Intention was to get used to different situations, repair, grow, fail, remove, etc.

After some playing, I started to check the files on the array and I found out that they were not (always) correct. So I started a check of the array, which returned some 1000 or more mismatches.

After some investigation, I found out that one HD had a "flaky" interface, data was correctly written, but sometimes, randomly, reading returned some "wrong" bits (re-cabling solved the issue).

Quoted 7 lines

To check this with RAID-6, I could run the check with 6 disks, for 7 times, each with a different disk removed, until one run returned no mismatches.
At this point, I knew which "data path" was defective.

It would have saved a lot of time, if the check could have done this automatically...

Exactly! this is partly the point i make too

Quoted 14 lines

So, my RFE, would be, if possible, to try, during RAID-6 check, to find out if and which HD has the mismatch.
Ideally, at the end of the check, the system log should show how many mismatches, if any, are likely to belong to which HD or are undetermined.
This would help to diagnose the full data path and reduce testing time in case of problems.
In case only one HD results problematic, this one could be failed, removed and the complete cabling, I/F and so on checked. Of course, this goes beyond the simple "HD failure protection" scope of RAID, nevertheless I do not see why this possibility should be neglected, unless it is too complex/difficult to implement and maintain.

Yeah, I myself do not know how much more complicated this would make things, but i would imagine it would be worth it..

Quoted 5 lines

Regarding the possibility of recovery, I have one question:

Why a RAID system might have inconsistencies?
Why do we have a "check" command at all, to run weekly or monthly?

As previously stated in discussion, while most bitflips etc does not happen on disk(apparently), they do happen, whether its in ram, pci, controller etc...

Also, i imagine its just to be on top of things, read and ensure stuff works.. (but this is pure speculation)

Quoted 6 lines

Thanks,

bye,

#5 lore raw
In reply to Piergiorgio Sartor
Quoted 3 lines · Piergiorgio Sartor

Why a RAID system might have inconsistencies?
Why do we have a "check" command at all, to run weekly or monthly?

Because alpha particles fly by, most systems don't have ECC memory, a passing truck and noisy jet create a beat frequency that causes a once in a century bit flip on a good cable connection, power line noise creeps in, or maybe an angel farts.

My question is why we don't use available techniques to fix this since we have the software to find it for us.

Signature · 3 lines
Bill Davidsen <[email protected]>
 "Woe unto the statesman who makes war without a reason that will still
 be valid when the war is over..." Otto von Bismark 
#6 lore raw
Quoted 28 lines

-----Original Message-----
From: [email protected] [mailto:linux-raid- [email protected]] On Behalf Of Bill Davidsen
Sent: Wednesday, December 17, 2008 8:49 AM
To: Piergiorgio Sartor
Cc: [email protected]
Subject: Re: detection/correction of corruption with raid6

Quoted 3 lines · Piergiorgio Sartor

Why a RAID system might have inconsistencies?
Why do we have a "check" command at all, to run weekly or monthly?

Because alpha particles fly by, most systems don't have ECC memory, a passing truck and noisy jet create a beat frequency that causes a once in a century bit flip on a good cable connection, power line noise creeps in, or maybe an angel farts.

My question is why we don't use available techniques to fix this since we have the software to find it for us.

--
Bill Davidsen <[email protected]>
"Woe unto the statesman who makes war without a reason that will
still
be valid when the war is over..." Otto von Bismark

Quoted 5 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

EEtimes published results from a 10-year IBM study. They found that alpha particles created a bit flip once a month per 256 MB of DRAM alone at sea level. I can't remember what it was in high altitude, but I think it was twice as bad. If you have 4GB of RAM in your computer, then even if you have parity memory, then you are going to have undetectable bit flips several times a month.

#8 lore raw
In reply to a message not in the archive

From: Bill Davidsen [mailto:[email protected]]
Sent: Wednesday, December 17, 2008 2:28 PM
To: David Lethe
Cc: Piergiorgio Sartor; [email protected]
Subject: Re: detection/correction of corruption with raid6

David Lethe wrote:
-----Original Message-----
From: [email protected] [mailto:linux-raid- [email protected]] On Behalf Of Bill Davidsen
Sent: Wednesday, December 17, 2008 8:49 AM
To: Piergiorgio Sartor
Cc: [email protected]
Subject: Re: detection/correction of corruption with raid6

Piergiorgio Sartor wrote:

Why a RAID system might have inconsistencies?
Why do we have a "check" command at all, to run weekly or monthly?

Because alpha particles fly by, most systems don't have ECC memory, a passing truck and noisy jet create a beat frequency that causes a once in a century bit flip on a good cable connection, power line noise creeps in, or maybe an angel farts.

My question is why we don't use available techniques to fix this since we have the software to find it for us.

--
Bill Davidsen <[email protected]>
"Woe unto the statesman who makes war without a reason that will
still
be valid when the war is over..." Otto von Bismark

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

EEtimes published results from a 10-year IBM study. They found that alpha particles created a bit flip once a month per 256 MB of DRAM alone at sea level. I can't remember what it was in high altitude, but I think it was twice as bad. If you have 4GB of RAM in your computer, then even if you have parity memory, then you are going to have undetectable bit flips several times a month.

Why undetectable with parity? Even with Hamming Code, not the most modern, you could correct all one bit errors and detect all two bit errors, using 1+log2(N) parity bits, for 2^N data bits. Last I checked parity memory had 8d+1p, and you have 8 parity bits available on a 64 bit fetch, more than enough. You would have to get three flips in a fetch before you wouldn't see it, and using some of the better ECC schemes I bet you would see three as well.

Signature · 42 lines
Bill Davidsen <[email protected]>
  "Woe unto the statesman who makes war without a reason that will still
  be valid when the war is over..." Otto von Bismark 

There is much more to it than that..   Your analysis doesn't factor in
that DRAM must refresh and it never gets read.  

Here is a great paper that explains everything, and gets into details,
and it avoids the calculus. 

http://www.tezzaron.com/about/papers/soft_errors_1_1_secure.pdf

To take a few quotes from it
"Memory errors occur mostly during read/write activity, so the SER rises
with memory speed and with the intensity of memory use; "memory cycling
at 100 nanoseconds can give soft error rates 100 times that of memory
idling in refresh mode (15 microseconds). Error rates rise with
altitude: SER is 5 times as high at 2600 feet as at sea level, and 10
times as high in Denver (5280 feet) as at sea level. SRAM tested at
10,000 feet above sea level will record SERs that are 14 times the rate
tested at sea level"

Quite aside from soft errors, particles with high energies can cause
permanent damage to memory cells. These "hard" errors exhibit error
rates that are strongly related to soft error rates, variously estimated
at 2% of total errors ...

Conclusions
Soft errors are a matter of increasing concern as memories get larger
and memory technologies get smaller. Even using a relatively
conservative error rate (500 FIT/Mbit), a system with 1 GByte of RAM can
expect an error every two weeks; a hypothetical Terabyte system would
experience a soft error every few minutes. Existing ECC technologies can
greatly reduce the error rate, but they may have unacceptable tradeoffs
in power, speed, price, or size. 

Soft errors can be disastrous for systems with large memories, critical
applications, or high altitude locations. Some type of error
detection/correction is mandatory in these cases, in spite of the cost
in price and/or performance."

David
#2 lore raw
In reply to Redeeman

On Tue, 2008-12-16 at 23:25 +0100, Redeeman wrote:
[...]

Quoted 5 lines
Quoted 2 lines

Why a RAID system might have inconsistencies?
Why do we have a "check" command at all, to run weekly or monthly?

As previously stated in discussion, while most bitflips etc does not happen on disk(apparently), they do happen, whether its in ram, pci, controller etc...

Ah! You spoiled it! :-)

Actually I was waiting for an answer from Neil Brown.

Because I'm under the impression that if it is not the HD, it does not count... See below...

Quoted 2 lines

Also, i imagine its just to be on top of things, read and ensure stuff works.. (but this is pure speculation)

I still have some comments on the topic.

First of all, someone mentioned the CRC/EDAC capabilities in the filesystem. While this would be advisable, there is a fundamental problem with it: there is no information on which device could have caused the error (in case of RAID).
The FS can report, maybe correct, the data, but it is unaware of the underlining hardware, so it does not help further. On the other end (not hand), there are the device drivers. Also these may report errors, but it can also be they just deliver garbage, for several reasons.
The only component which can handle the problem is the "md", since this is the only one which knows the devices _and_ the data.

Second. As mentioned above, it seems to me that RAID scope is intentionally limited to pure HD failures.
Nowadays, one could build a RAID over usb-storage plus fw-sbp2 plus nbd plus esata.
The "HD" is not anymore the physical thing, it is everything from the specific driver on.
If I stomp on the USB cable, detaching it, I would like the RAID reacting as a real HD failure occurred (actually it does it properly).

So, IMHO, the argument that the "soft errors are improbable within the HD" is limited, since it can happen elsewhere and it should count like it was in the HD, IMHO...

Final point. More or less one year ago the same topic popped up, with similar discussion.
At the end of the thread someone was asking if patches are accepted in order to implement this feature.
I could not find any answer to that question in the archive.

What is the idea? Are patches accepted? Rejected by default?

Not that I want to provide one, but I was just curious...

bye,

Signature · 1 line
pg
#3 lore raw
Quoted 8 lines · On Wednesday December 17, [email protected] wrote:

On Tue, 2008-12-16 at 23:25 +0100, Redeeman wrote:
[...]

Quoted 5 lines
Quoted 2 lines

Why a RAID system might have inconsistencies?
Why do we have a "check" command at all, to run weekly or monthly?

As previously stated in discussion, while most bitflips etc does not happen on disk(apparently), they do happen, whether its in ram, pci, controller etc...

Quoted 6 lines

Ah! You spoiled it! :-)

Actually I was waiting for an answer from Neil Brown.

Because I'm under the impression that if it is not the HD, it does not count... See below...

Suppose we agree that bit flips don't happen (undetected) on drive media. But that bit flips can happen elsewhere (memory. IO Buss etc).

And then suppose we discover that a bit-flip has happened. What does that tell us?
Maybe it tells us that our hardware is dodgey. So it cannot be trusted to reliably do anything we tell it. So maybe we shouldn't tell it to do anything. ??

And when we find a corruption, we clear cannot know if it is corrupt on disk (a previous write went bad) or just in memory (e.g. a recent read was bad).
In the latter case, writing anything to disk is probably the wrong thing to do. In the former case it might be a good thing to do - if we can be fairly sure that the error happens very rarely. And of course we cannot know if it was due to a bad read or a bad write. So the safe course is to not write anything to disk.

Where does that leave us?

About the only thing that makes sense is to always read all the blocks in a stripe, and to perform a consistency test before responding to any read request. If an inconsistency is found, we log what we know, and only return data if we have some reason to believe something is still valid (e.g. a majority vote for raid1).

And for raid5/6, a write would require:
read whole stripe
check consistency
copy in new data
update parity
write out changed blocks

This is going to be a substantial slowdown.

And does it really increase your data security? or is it like putting a lock on your front door but not on your back door?

I guess it would provide some protection against low-frequency errors in the controller/cable/drive.

But given the high cost and the fairly low value, I wonder how many people would really use it....

Quoted 8 lines

Final point. More or less one year ago the same topic popped up, with similar discussion.
At the end of the thread someone was asking if patches are accepted in order to implement this feature.
I could not find any answer to that question in the archive.

What is the idea? Are patches accepted? Rejected by default?

By default, patches are reviewed and discussed. If they then get revised and tested and appear to be sensible and useful they will probably get accepted eventually.

A change of this magnitude would almost certainly need to go through several iterations of revision and have substantial testing before being accepted.

NeilBrown

#4 lore raw
Quoted 52 lines · Neil Brown
Quoted 8 lines · On Wednesday December 17, [email protected] wrote:

On Tue, 2008-12-16 at 23:25 +0100, Redeeman wrote:
[...]

Quoted 5 lines
Quoted 2 lines

Why a RAID system might have inconsistencies?
Why do we have a "check" command at all, to run weekly or monthly?

As previously stated in discussion, while most bitflips etc does not happen on disk(apparently), they do happen, whether its in ram, pci, controller etc...

Quoted 6 lines

Ah! You spoiled it! :-)

Actually I was waiting for an answer from Neil Brown.

Because I'm under the impression that if it is not the HD, it does not count... See below...

Suppose we agree that bit flips don't happen (undetected) on drive media. But that bit flips can happen elsewhere (memory. IO Buss etc).

And then suppose we discover that a bit-flip has happened. What does that tell us?
Maybe it tells us that our hardware is dodgey. So it cannot be trusted to reliably do anything we tell it. So maybe we shouldn't tell it to do anything. ??

And when we find a corruption, we clear cannot know if it is corrupt on disk (a previous write went bad) or just in memory (e.g. a recent read was bad).
In the latter case, writing anything to disk is probably the wrong thing to do. In the former case it might be a good thing to do - if we can be fairly sure that the error happens very rarely. And of course we cannot know if it was due to a bad read or a bad write. So the safe course is to not write anything to disk.

Where does that leave us?

About the only thing that makes sense is to always read all the blocks in a stripe, and to perform a consistency test before responding to any read request. If an inconsistency is found, we log what we know, and only return data if we have some reason to believe something is still valid (e.g. a majority vote for raid1).

And for raid5/6, a write would require:
read whole stripe
check consistency
copy in new data
update parity
write out changed blocks

This is going to be a substantial slowdown.

Quoted 8 lines

And does it really increase your data security? or is it like putting a lock on your front door but not on your back door?

I guess it would provide some protection against low-frequency errors in the controller/cable/drive.

But given the high cost and the fairly low value, I wonder how many people would really use it....

I was suggesting that we only go through all the hoops on user request.. e.g. the addition of "resync_majorityvote" or something..

I can see the wisdom in just doing normal read/writes as now, for speed, and only do the additional logic on request.

Quoted 23 lines
Quoted 9 lines

Final point. More or less one year ago the same topic popped up, with similar discussion.
At the end of the thread someone was asking if patches are accepted in order to implement this feature.
I could not find any answer to that question in the archive.

What is the idea? Are patches accepted? Rejected by default?

By default, patches are reviewed and discussed. If they then get revised and tested and appear to be sensible and useful they will probably get accepted eventually.

A change of this magnitude would almost certainly need to go through several iterations of revision and have substantial testing before being accepted.

NeilBrown
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html