Degraded raid handling

Heinz Mauelshagen mauelshagen at redhat.com
Wed May 16 15:15:39 UTC 2007


On Tue, May 15, 2007 at 05:24:52PM -0400, Phillip Susi wrote:
> I have been trying to figure out how dmraid handles degraded raid sets. 
>  For example, if only one drive in a mirror is found, or one drive in a 
> raid5 is missing.  I have found several states for the raid set listed 
> in the source in metadata.h:
> 
> s_broken
> s_inconsistent
> s_nosync
> s_ok
> s_setup

Those are defined to cover states for a 'broken' set (i.e. non-recoverable),
'inconsistent' (i.e. recoverable), 'nosync' (i.e. set has to be resolvered,
'ok' (i.e. set is fully synced and devices accessible) and 'setup', which is
an interim state during metadata setup, hence transition will go from 'setup'
to any of the others when the sets metadata got fully discovered and grouped.

> 
> What I can't figure out is the meaning of these states, or if they are 
> even implemented.  The meaning of s_ok is obvious, but if one of the 
> mirrors is missing, does the state become inconsistent or nosync?  If 
> these flags are used on the raid set, I can not find it in the code.  It 
> seems that some of these states are referenced in the ataraid metadata 
> specific handlers in the context of each device rather than the set as a 
> whole.  How does it make sense to have each device in one of these 
> states vs. the set as a whole?
> 
> One of the only places I can find these states referenced on the raid 
> set is in activate.c, and I can not make sense out of it:
> 
>    return (p_fmt(lc, table, "0 %U %s core 2 %u %s %u", 
> 
>               sectors, get_dm_type(lc, t_raid1), 
> 
>               calc_region_size(lc, sectors), 
> 
>               (S_INCONSISTENT(rs->status) || S_NOSYNC(rs->status)) ? 
> 
>               "sync" : "nosync", mirrors));
> 
> This looks to me that it is adding a "sync" parameter to the dmsetup 
> command if the raid set is either out of sync or inconsistent, and 
> otherwise adds "nosync".  Not only does this seem to be backwards,

No, if the RAID set is out of sync it needs to be synced, which is what
the 'sync' parameter means.

> but 
> as far as I can tell ( from looking at the kernel sources since I can 
> find no documentation on the mirror target ) there are no such 
> parameters.

Those are handled by the dirty log (dm-log.c), not by any dm target directly.

> Further, I can not see anywhere the s_inconsistent or 
> s_nosync flags ever can be set on the raid set.  What gives?

The fact, that a dmeventd DSO still needs implementing in order to make
use of those. Such DSO will handle device evvent based state changes
and reated ondisk metadata updates (e.g. replacement of a broken drive
by a spare one).

> 
> I'd like to be able to set up the udev scripts to run dmraid on newly 
> attached disks to check if they are a part of a raid volume, and if they 
> are, try to activate that volume, but only if all disks are available. 

Use "dmraid -r -c... device-path".

> If one is missing, then the set should not be activated in a degraded 
> set, at least not until some timeout has passed to give the other disk a 
> chance to be detected.  This is a bit of a moot point though, if dmraid 
> doesn't support degraded sets.

Well, it does.
Degraded mirrors get activeted as linera devices unless there's a metadata
format handler bug.

> 
> _______________________________________________
> Ataraid-list mailing list
> Ataraid-list at redhat.com
> https://www.redhat.com/mailman/listinfo/ataraid-list

-- 

Regards,
Heinz    -- The LVM Guy --

*** Software bugs are stupid.
    Nevertheless it needs not so stupid people to solve them ***

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Heinz Mauelshagen                                 Red Hat GmbH
Consulting Development Engineer                   Am Sonnenhang 11
Storage Development                               56242 Marienrachdorf
                                                  Germany
Mauelshagen at RedHat.com                            PHONE +49  171 7803392
                                                  FAX   +49 2626 924446
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-




More information about the Ataraid-list mailing list