Bug with RAID1 hot spares?
Greetings,
I was just testing a server I was about to send into production on kernel
2.6.18.1. The server has three SCSI disks with "md1" set to a RAID1 with 2 mirrors and 1 spare. The mirrors are sda3 and sdb3, spare is sdc3. I manually failed sdb3, and as expected, sdc3 was activated. Strangely
enough, /proc/mdstat did not indicate that sdc3 was being synced. I thought these spares weren't kept mirrored until needed?
In order to further test my theory, I manually failed sda3, leaving only sdc3
(the original spare) active. I ran "find /" for a bit to see if any errors cropped up and none did; however, when I added sda3 and sdb3 back to the array and a resync started, I was soon faced with what appeared to be a _very_ corrupted reiserfs.
Strangely enough, after booting on a livecd and assembling md1 with just
sda3, I was able to add sdb3 and sdc3, after which the array resynced and left sdb3 a mirror and sdc3 a spare.
So there's definitely something odd happening here... why did no resync to
the sdc3 spare start when I failed sdb3?
Thanks,
Chase
Quoted 7 lines · On Friday October 20, [email protected] wrote:
Greetings,
I was just testing a server I was about to send into production on kernel
2.6.18.1. The server has three SCSI disks with "md1" set to a RAID1 with 2 mirrors and 1 spare. The mirrors are sda3 and sdb3, spare is sdc3. I manually failed sdb3, and as expected, sdc3 was activated. Strangely
enough,/proc/mdstatdid not indicate that sdc3 was being synced. I thought these spares weren't kept mirrored until needed?
Correct. They are not kept mirrored.
Quoted 2 lines
So there's definitely something odd happening here... why did no resync to
the sdc3 spare start when I failed sdb3?
yes... can you check that this fixes it please?
Thanks,
NeilBrown
### Diffstat output
./drivers/md/md.c | 1 + 1 file changed, 1 insertion(+)
drivers/md/md.c +1 -0
@@ -2003,6 +2003,7 @@ static mdk_rdev_t *md_import_device(dev_kobject_init (&rdev->kobj); rdev->desc_nr =-1 ; + rdev->saved_raid_disk =-1 ; rdev->flags =0 ; rdev->data_offset =0 ; rdev->sb_events =0 ;
Quoted 4 lines · Chase Venters
Greetings,
I was just testing a server I was about to send into production on kernel
2.6.18.1. The server has three SCSI disks with "md1" set to a RAID1 with 2 mirrors and 1 spare.
I have to ask, why? If the array is mostly written you might save a bit of bus time, but for reads having another copy of the data to read (usually) helps the performance by reducing wait for read occurences.
Signature · 3 lines
bill davidsen <[email protected]> CTO TMR Associates, Inc Doing interesting things with small computers since 1979
Quoted 9 lines · Bill Davidsen
Quoted 4 lines · Chase Venters
Greetings,
I was just testing a server I was about to send into production on kernel
2.6.18.1. The server has three SCSI disks with "md1" set to a RAID1 with 2 mirrors and 1 spare.I have to ask, why? If the array is mostly written you might save a bit of bus time, but for reads having another copy of the data to read (usually) helps the performance by reducing wait for read occurences.
The main idea is to not exercise the spare as much as the other disks. All three disks are from the same lot. Having three disks fail at once is admittedly unlikely, but keeping one disk as a spare rather than full mirror should probably reduce the wear on that disk so if there is some manufacturing defect the third drive wouldn't be as close to failing and could hopefully keep the box online until someone makes it to the datacenter to do a swap.
Thanks,
Chase
Quoted 1 line · Chase Venters
The main idea is to not exercise the spare as much as the other disks. All
Btw. you can also keep the spare-disk spinned down most of the time. You should probably just make sure to spin it up from time to time to see if it's still okay - I spin up my spares one hour per night when smartd issues short selftests and a few more hours when smartd issues long selftests.
regards
Mario
Signature · 4 lines
<jv> Oh well, config <jv> one actually wonders what force in the universe is holding it <jv> and makes it working <Beeth> chances and accidents :)