Bug 1290494 - Degraded RAID1 MD Array becomes inactive after rebooting the system. [NEEDINFO]
Degraded RAID1 MD Array becomes inactive after rebooting the system.
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: mdadm (Show other bugs)
7.2
x86_64 Linux
high Severity high
: rc
: 7.3
Assigned To: XiaoNi
Zhang Yi
Milan Navratil
dell_server
:
Depends On:
Blocks: 1313485 1274397 1304407 1364088
  Show dependency treegraph
 
Reported: 2015-12-10 11:49 EST by Nanda Kishore Chinnaram
Modified: 2017-02-24 15:01 EST (History)
17 users (show)

See Also:
Fixed In Version: mdadm-3.4-3.el7
Doc Type: Bug Fix
Doc Text:
A degraded RAID1 array created with *mdadm* is no longer shown as inactive after rebooting Previously, a degraded RAID1 array that was created using the *mdadm* utility could be shown as an inactive RAID0 array after rebooting the system. With this update, the array is started correctly after the system is rebooted.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-11-03 20:07:47 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
nanda_kishore_chinna: needinfo? (nkshirsa)


Attachments (Terms of Use)
SOS report (6.22 MB, application/x-xz)
2015-12-10 11:49 EST, Nanda Kishore Chinnaram
no flags Details
The patch file (762 bytes, patch)
2016-01-06 08:53 EST, XiaoNi
no flags Details | Diff


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 2252841 None None None 2016-04-11 17:37 EDT

  None (edit)
Description Nanda Kishore Chinnaram 2015-12-10 11:49:44 EST
Created attachment 1104411 [details]
SOS report

Description of problem:
Degraded RAID-1 Array that was created using mdadm becomes inactive and its status is shown as raid0 after the system is rebooted.

Version-Release number of selected component (if applicable):
3.3.2-7

How reproducible:
Always

Steps to Reproduce:
1. Create RAID-1 Array.
mdadm -C /dev/md1 --metadata=1.2 -l1 -n2 /dev/sdb1 /dev/sdc1

2. Save the Configuration details.
mdadm --examine --scan > /etc/mdadm.conf

3. Degrade the Array by unplugging one of the Drives of Array.

4. Status of the Array is shown as Degraded.
mdadm -D /dev/md1

5. Reboot the system

Actual results:
The status of the Array should be shown as Degraded and active.

Expected results:
The status of the Array is shown as inactive and in raid0 mode.

Additional info:
After the system  is rebooted, if the Array is stopped and re-assembled, then status is shown as degraded and active.
Comment 1 Nanda Kishore Chinnaram 2015-12-21 01:50:46 EST
Correcting the Actual and Expected Results.

* Expected results:
The status of the Array should be shown as Degraded, Raid1 and active.

* Actual results:
The status of the Array is shown as inactive and in raid0 mode.
Comment 6 Lakshmi_Narayanan_Du 2016-01-06 06:41:01 EST
Following is my analysis
 
 # when one of the drive of RAID 1 array is unplugged the array is 
hooking "static int restart_array(struct mddev *mddev)" [driver/md/md.c]
and sets "read-auto" mode in 
/sys/devices/virtual/block/md9/md/array_state

# Seems we may need to "run" the array to make it active again  

[Optional]
# one manual way I could see is after degrade before reboot run "mdadm - /dev/md9" and then reboot it works fine .But this cannot be a automatic solution 

# But since we are rebooting without the above step the state  "/sys/devices/virtual/block/md9/md/array_state"
  remains "read-auto"

# While the system reboots it marks this "inactive" and also doesnot print the valid values from the sys path 

# So During/At reboot time hooking the "run" is making it active

"mdadm --R /dev/md9"


I could see a dracut patch mdraid_start that makes mandatory "run" over all the array's

https://github.com/zfsonlinux/dracut/blob/master/modules.d/90mdraid/mdraid_start.sh

To my understanding defining a rule in Udev rules.d might help 

Working on to understand it further

Thanks
Lakshmi
Comment 7 XiaoNi 2016-01-06 08:53 EST
Created attachment 1112184 [details]
The patch file

Hi Lakshmi

There is already a patch for this. I tried it and it can fix the problem. The attachment is the patch.

Thanks
Xiao
Comment 8 Lakshmi_Narayanan_Du 2016-01-09 05:46:30 EST
Sure Xiao .Thanks for the update 

Regards
Lakshmi
Comment 10 Harald Hoyer 2016-04-13 09:34:09 EDT
(In reply to Lakshmi_Narayanan_Du from comment #6)
> Following is my analysis
>  
>  # when one of the drive of RAID 1 array is unplugged the array is 
> hooking "static int restart_array(struct mddev *mddev)" [driver/md/md.c]
> and sets "read-auto" mode in 
> /sys/devices/virtual/block/md9/md/array_state
> 
> # Seems we may need to "run" the array to make it active again  
> 
> [Optional]
> # one manual way I could see is after degrade before reboot run "mdadm -
> /dev/md9" and then reboot it works fine .But this cannot be a automatic
> solution 
> 
> # But since we are rebooting without the above step the state 
> "/sys/devices/virtual/block/md9/md/array_state"
>   remains "read-auto"
> 
> # While the system reboots it marks this "inactive" and also doesnot print
> the valid values from the sys path 
> 
> # So During/At reboot time hooking the "run" is making it active
> 
> "mdadm --R /dev/md9"
> 
> 
> I could see a dracut patch mdraid_start that makes mandatory "run" over all
> the array's
> 
> https://github.com/zfsonlinux/dracut/blob/master/modules.d/90mdraid/
> mdraid_start.sh

Huh? Why are you using the "zfsonlinux" github clone?

> 
> To my understanding defining a rule in Udev rules.d might help 
> 
> Working on to understand it further
> 
> Thanks
> Lakshmi

Might be better in the md-shutdown script:
<https://github.com/dracutdevs/dracut/blob/master/modules.d/90mdraid/md-shutdown.sh>
Comment 11 Harald Hoyer 2016-04-13 09:37:33 EDT
(In reply to Harald Hoyer from comment #10)
> (In reply to Lakshmi_Narayanan_Du from comment #6)
> > Following is my analysis
> >  
> >  # when one of the drive of RAID 1 array is unplugged the array is 
> > hooking "static int restart_array(struct mddev *mddev)" [driver/md/md.c]
> > and sets "read-auto" mode in 
> > /sys/devices/virtual/block/md9/md/array_state
> > 
> > # Seems we may need to "run" the array to make it active again  
> > 
> > [Optional]
> > # one manual way I could see is after degrade before reboot run "mdadm -
> > /dev/md9" and then reboot it works fine .But this cannot be a automatic
> > solution 
> > 
> > # But since we are rebooting without the above step the state 
> > "/sys/devices/virtual/block/md9/md/array_state"
> >   remains "read-auto"
> > 
> > # While the system reboots it marks this "inactive" and also doesnot print
> > the valid values from the sys path 
> > 
> > # So During/At reboot time hooking the "run" is making it active
> > 
> > "mdadm --R /dev/md9"
> > 
> > 
> > I could see a dracut patch mdraid_start that makes mandatory "run" over all
> > the array's
> > 
> > https://github.com/zfsonlinux/dracut/blob/master/modules.d/90mdraid/
> > mdraid_start.sh
> 
> Huh? Why are you using the "zfsonlinux" github clone?
> 
> > 
> > To my understanding defining a rule in Udev rules.d might help 
> > 
> > Working on to understand it further
> > 
> > Thanks
> > Lakshmi
> 
> Might be better in the md-shutdown script:
> <https://github.com/dracutdevs/dracut/blob/master/modules.d/90mdraid/md-
> shutdown.sh>

Although this is probably only interesting for the root on MD case.
Comment 14 Nanda Kishore Chinnaram 2016-08-09 18:13:21 EDT
Verified the issue in RHEL 7.3 Alpha1 Build. It's resolved.
Comment 16 Nanda Kishore Chinnaram 2016-09-14 02:53:03 EDT
Hi nikhil, what information do you need ?
Comment 20 errata-xmlrpc 2016-11-03 20:07:47 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2016-2182.html

Note You need to log in before you can comment on or make changes to this bug.