about:conf->recovery_disabled and mddev->recovery_disabled
Hi all:
I confused the recovery_disabled.
what's the mean when conf->recovery_disabled = mddev->recovery_disabled?
If equal,so not to add disk and not to recovery?
Thanks!
--------------
majianpeng
2012-04-07
Quoted 4 lines · On Sat, 7 Apr 2012 17:13:22 +0800 "majianpeng" <[email protected]> wrote:
Hi all:
I confused therecovery_disabled.
what's the mean whenconf->recovery_disabled=mddev->recovery_disabled? If equal,so not to add disk and not to recovery?
Yes, exactly.
in an attempt to recover a device fails we don't want to immediately retry as that would cause a loop.
So whenever a recovery fails, we set conf->recovery_disabled to match mddev->recovery_disable. And whenever something changes which might make recovery possible, we increment mddev->recovery_disabled, so that it tries again.
With raid10, the 'recovery_disabled' is per-disk, not per-array.
NeilBrown
I readed the raid1:error(),I can't understand this code:
/*
* If it is not operational, then we have already marked it as dead
* else if it is the last working disks, ignore the error, let the
* next level up know.
* else mark the drive as failed
*/
if (test_bit(In_sync, &rdev->flags)
&& (conf->raid_disks - mddev->degraded) == 1) {
/*
* Don't fail the drive, act as though we were just a
* normal single drive.
* However don't try a recovery from this drive as
* it is very likely to fail.
*/
conf->recovery_disabled = mddev->recovery_disabled;
return;
}question 1:
If error occur and the raid1 is recoveying,but the error did not occur because recovery operation.The recovery will continue.
question 2:
when error occur,The disk may have to many error.so the code is :
conf->recovery_disabled = mddev->recovery_disabled;
But I can add a spare disk and recovery.
Is it correctly?
Thanks!
------------------
majianpeng
2012-04-10
-------------------------------------------------------------
发件人:NeilBrown
发送日期:2012-04-09 08:03:38
收件人:majianpeng
抄送:linux-raid
主题:Re: about:conf->recovery_disabled and mddev->recovery_disabled
Quoted 4 lines · On Sat, 7 Apr 2012 17:13:22 +0800 "majianpeng" <[email protected]> wrote:
Hi all:
I confused therecovery_disabled.
what's the mean whenconf->recovery_disabled=mddev->recovery_disabled? If equal,so not to add disk and not to recovery?
Yes, exactly.
in an attempt to recover a device fails we don't want to immediately retry as that would cause a loop.
So whenever a recovery fails, we set conf->recovery_disabled to match mddev->recovery_disable. And whenever something changes which might make recovery possible, we increment mddev->recovery_disabled, so that it tries again.
With raid10, the 'recovery_disabled' is per-disk, not per-array.
NeilBrown