From: Neil Brown <neilb@suse.de>
To: Eyal Lebedinsky <eyal@eyal.emu.id.au>
Cc: Christian Pernegger <pernegger@gmail.com>, linux-raid@vger.kernel.org
Subject: Re: mismatch_cnt questions
Date: Mon, 5 Mar 2007 09:30:32 +1100 [thread overview]
Message-ID: <17899.18568.523543.478792@notabene.brown> (raw)
In-Reply-To: message from Eyal Lebedinsky on Monday March 5
On Monday March 5, eyal@eyal.emu.id.au wrote:
> Neil Brown wrote:
> > On Sunday March 4, pernegger@gmail.com wrote:
> >>I have a mismatch_cnt of 384 on a 2-way mirror.
> [trim]
> >>3) Is the "repair" sync action safe to use on the above kernel? Any
> >>other methods / additional steps for fixing this?
> >
> > "repair" is safe, though it may not be effective.
> > "repair" for raid1 was did not work until Jan 26th this year.
> > Before then it was identical in effect to 'check'.
>
> How is "repair" safe but not effective? When it finds a mismatch, how does
> it know which part is correct and which should be fixed (which copy of
> raid1, or which block in raid5)?
It is not 'effective' in that before 26jan2007 it did not actually
copy the chosen data on to the other drives. i.e. a 'repair' had the
same effect as a 'check', which is 'safe'.
>
> When a disk fails we know what to rewrite, but when we discover a mismatch
> we do not have this knowledge. It may corrupt the good copy of a raid1.
If a block differs between the different drives in a raid1, then no
copy is 'good'. It is possible that one copy is the one you think you
want, but you probably wouldn't know by looking at it.
The worst situation is the have inconsistent data. If you read and get
one value, then later read and get another value, that is really bad.
For raid1 we 'fix' and inconsistency by arbitrarily choosing one copy
and writing it over all other copies.
For raid5 we assume the data is correct and update the parity.
You might be able to imagine a failure scenario where this produces
the 'wrong' result, but I'm confident that is the majority of cases it
is as good as any other option.
If we had something like ZFS which tracks checksums for all blocks,
and could somehow get that information usefully into the md level,
than maybe we could do something better.
I suspect that it would be very rare for raid5 to detect a mismatch
during a 'check', and raid1 would only see them when a write was
aborted, such as swap can do, and filesystems might do occasionally
(e.g. truncate a file that was recently written to).
NeilBrown
next prev parent reply other threads:[~2007-03-04 22:30 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-04 11:22 mismatch_cnt questions Christian Pernegger
2007-03-04 11:50 ` Neil Brown
2007-03-04 12:01 ` Christian Pernegger
2007-03-04 22:19 ` Neil Brown
2007-03-06 10:04 ` mismatch_cnt questions - how about raid10? Peter Rabbitson
2007-03-06 10:20 ` Neil Brown
2007-03-06 10:56 ` Peter Rabbitson
2007-03-06 10:59 ` Justin Piszcz
2007-03-12 5:35 ` Neil Brown
2007-03-12 14:26 ` Peter Rabbitson
2007-03-04 21:21 ` mismatch_cnt questions Eyal Lebedinsky
2007-03-04 22:30 ` Neil Brown [this message]
2007-03-05 7:45 ` Eyal Lebedinsky
2007-03-05 14:56 ` detecting/correcting _slightly_ flaky disks Michael Stumpf
2007-03-05 15:09 ` Justin Piszcz
2007-03-05 17:01 ` Michael Stumpf
2007-03-05 17:11 ` Justin Piszcz
2007-03-07 0:14 ` Bill Davidsen
2007-03-07 1:37 ` Michael Stumpf
2007-03-07 13:57 ` berk walker
2007-03-07 15:01 ` Bill Davidsen
2007-03-05 23:40 ` mismatch_cnt questions Neil Brown
2007-03-07 0:22 ` Bill Davidsen
2007-03-08 6:39 ` H. Peter Anvin
2007-03-08 13:54 ` Martin K. Petersen
2007-03-09 2:00 ` Bill Davidsen
2007-03-09 4:20 ` H. Peter Anvin
2007-03-09 5:20 ` Bill Davidsen
2007-03-08 6:34 ` H. Peter Anvin
2007-03-08 7:00 ` H. Peter Anvin
2007-03-08 8:21 ` H. Peter Anvin
2007-03-13 9:58 ` Andre Noll
2007-03-13 23:46 ` H. Peter Anvin
2007-03-06 6:27 ` Paul Davidson
2008-05-12 11:16 ` Bas van Schaik
2008-05-12 14:31 ` Justin Piszcz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=17899.18568.523543.478792@notabene.brown \
--to=neilb@suse.de \
--cc=eyal@eyal.emu.id.au \
--cc=linux-raid@vger.kernel.org \
--cc=pernegger@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).