linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.de>
To: Ralph Berrett <ralph.berrett@avid.com>
Cc: "linux-raid@vger.kernel.org" <linux-raid@vger.kernel.org>
Subject: Re: A disk failure during the initial resync after create, does not always suspend the resync to start the recovery
Date: Wed, 27 Jun 2012 08:57:18 +1000	[thread overview]
Message-ID: <20120627085718.4d67b9b6@notabene.brown> (raw)
In-Reply-To: <0B3484EB4B5B284199C5204D116920FC047E8D@WAL-MBS04.global.avidww.com>

[-- Attachment #1: Type: text/plain, Size: 3023 bytes --]

On Tue, 26 Jun 2012 21:14:54 +0000 Ralph Berrett <ralph.berrett@avid.com>
wrote:

> A disk failure during the initial resync after create, does not always suspend the resync to start the recovery
>  
> Steps:
> 1. Create multiple Raid6 arrays (in my case 8 arrays, this is a large storage system)
> 2. Create 2 spares (with one spare in md1 and other in md5)
> 3. Set two different "spare-group" in /etc/mdamd/mdadm.conf so that md1-md4 and md5-md8 each share one of the two spare.
> 4. While resync is still in progress, fail a disk in the arrays that do not have the spare (physically pulled).
> 5. The spare drive is moved from to the effected array via mdadm --monitor daemon that is running. But the "recovery" does not always started. Most of the time it waits for the "resync" to complete before starting the "recovery", but not always.
>  
> Which is the expected behavior, should it stop the resync to do the recovery or not?  If not, since these are fairly large arrays, the "resync" could take a while before it even starts the "recovery" leaving the system in degraded state.  From my experiments, the "resync" is not stopped more often than it is stopped.
>  
> The only workaround I have found is to send "echo "ilde" > /sys/block/md2/md/sync_action" which will suspend the resync and then the recovery will start.  This is a intended as a embedded system so this is not an optimal workaround.
>  
> emDebain 6.0.4
> Kernel:    2.6.32
> mdadm:   v3.1.4 - 31st August 2010
>  

I've never given a lot of thought to this scenario so the way that it works
is simply how the different bits fall together, not anything deliberate.

If a device failed in an array which did not currently have a spare attached,
I would expect the resync to restart and when the spare gets moved over the
resync would continue and when it completes a recovery would start.

If a device failed in an array which already had a spare attached - I would
have to check the code to see what would happen but I can certainly imagine
that a recovery of that spare would start, and it may well resync the other
parity block at the same time. 

It should  be deterministic though - I can't see much room for any random
element.

As the initial sync of RAID6 isn't really needed anyway, it is clear that it
should be interrupted and the recovery preformed instead.
However if a sync is happening after an unclean restart when a device fails,
it isn't clear to me what the preferred option is.
Allowing the sync to complete means your data will be protected from another
failure sooner.
Allowing the recovery to start immediately means that you will get all your
bandwidth to the array back sooner, and you'll be protected from double
failure sooner.

Maybe if the sync is less than half way, interrupt it. If more than half way,
abort it?

The way I would  'fix' this would be to modify mdadm to write 'idle' to
'sync_action' at an appropriate time (after moving the spare over).

NeilBrown

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

      reply	other threads:[~2012-06-26 22:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-26 21:14 A disk failure during the initial resync after create, does not always suspend the resync to start the recovery Ralph Berrett
2012-06-26 22:57 ` NeilBrown [this message]

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=20120627085718.4d67b9b6@notabene.brown \
    --to=neilb@suse.de \
    --cc=linux-raid@vger.kernel.org \
    --cc=ralph.berrett@avid.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).