From: NeilBrown <neilb@suse.com>
To: Peter Sangas <pete@wnsdev.com>,
'Stephane Thiell' <sthiell@stanford.edu>,
linux-raid@vger.kernel.org
Subject: RE: mismatch_cnt > 0 during initial sync?
Date: Tue, 20 Jun 2017 14:14:59 +1000 [thread overview]
Message-ID: <87lgon2t30.fsf@notabene.neil.brown.name> (raw)
In-Reply-To: <009901d2e946$a3eff400$ebcfdc00$@wnsdev.com>
[-- Attachment #1: Type: text/plain, Size: 2556 bytes --]
On Mon, Jun 19 2017, Peter Sangas wrote:
>> From: NeilBrown [mailto:neilb@suse.com]
>> Sent: Sunday, June 18, 2017 2:35 PM
>> Subject: Re: mismatch_cnt > 0 during initial sync?
>>
>>
>> From the perspective of md, the initial sync is no different from any
> other sync. It
>> will count the number of mismatches that it finds and fixes.
>>
>
> Should a sync always fix a mismatch it encounters? I have a RAID1 with 3
> disks. Sometimes I need to replace one disk and after adding a replacement
> disk syslog indicates "RebuildFinished event detected on md device
> /dev/md/2, component device mismatches found: 256 (on raid level 1)" but
> says nothing about fixing it.
No, it wouldn't say anything about fixing things. That is assumed.
>
> cat /sys/block/md2/md/last_sync_action
> recovery
This is a recovery, not a resync. They are different.
Recovery is when you add a device to an array, and the data that should
be there is recovered from elsewhere.
Resync is when the redundancy in the array might be compromised, so it
is repaired, possibly by read-check-maybe_write. Possibly by
read-write.
For raid1, recovery and resync and require similar. For raid5 they are
very different.
The mismatch count is only reset when a resync starts, not when a
recovery (or reshape) starts. So mdadm shouldn't really report the
mismatches when the recovery finishes. The number is left over from the
most recent resync.
raid1 only counts when a resync is requested, either by writing "check"
or "repair" to the sync_action file in sysfs. An automatic resync after
and unclean shutdown (or when array is started) just copies blocks
without checking, so it has nothing to count.
"repair" repairs any inconsistencies found, "check" doesn't. Both count
inconsistencies.
raid5/raid6 counts for resync, check, and repair (but not for recover or
reshape).
By default, when the array is created, raid5 performs a recovery,
nominating one of the devices to be the "spare" with the others assumed
to have "correct" data. This is faster than assuming they are all
"correct", and performing a resync.
RAID6 (the array used in the original question) does resync, rather than
recovery, on initial creation - because 2-drive recovery is/was thought
to have performance issues.
So: mdadm should be modified to not report "mismatches found" is
"last_sync_action" is recovery or reshape.
Thanks,
NeilBrown
>
> mdadm -V
> mdadm - v3.3 - 3rd September 2013
>
>
> Thank you,
> Pete
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
next prev parent reply other threads:[~2017-06-20 4:14 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-24 22:01 mismatch_cnt > 0 during initial sync? Stephane Thiell
2017-04-25 5:14 ` Stephane Thiell
2017-06-16 17:28 ` Peter Sangas
2017-06-18 21:34 ` NeilBrown
2017-06-19 21:54 ` Peter Sangas
2017-06-20 4:14 ` NeilBrown [this message]
2017-06-20 20:23 ` Peter Sangas
2017-06-20 21:26 ` NeilBrown
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=87lgon2t30.fsf@notabene.neil.brown.name \
--to=neilb@suse.com \
--cc=linux-raid@vger.kernel.org \
--cc=pete@wnsdev.com \
--cc=sthiell@stanford.edu \
/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).