Bug 769323 - mdadm write intent map not functioning as before
mdadm write intent map not functioning as before
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: mdadm (Show other bugs)
16
x86_64 Linux
unspecified Severity medium
: ---
: ---
Assigned To: Jes Sorensen
Fedora Extras Quality Assurance
:
Depends On:
Blocks: 791159 807743
  Show dependency treegraph
 
Reported: 2011-12-20 09:09 EST by Stephen P. Schaefer
Modified: 2012-06-06 22:53 EDT (History)
4 users (show)

See Also:
Fixed In Version: mdadm-3.2.3-7.fc16
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 791159 807743 (view as bug list)
Environment:
Last Closed: 2012-04-25 23:25:20 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Stephen P. Schaefer 2011-12-20 09:09:03 EST
Description of problem:

When a temporarily missing RAID 1 component becomes available, an incremental assembly should consult the write intent map and resynchronize the device with those blocks recorded as changed.  Instead, "mdadm -I --run /dev/sdc1" declares the temporarily missing component "invalid".

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

mdadm-3.2.2-125.fc16.x86_64
kernel-3.1.5-6.fc16.x86_64

How reproducible:

Always.

Steps to Reproduce:
1.  Create a RAID 1 device as so:

mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sdb1 --write-mostly /dev/sdc1 --bitmap=/var/preserve/vg_extern0 --assume-clean

3. Record the result of "mdadm -D --brief /dev/md0" in /etc/mdadm.conf:

ARRAY /dev/md0 metadata=1.2 bitmap=/var/preserve/extern0 name=myhost:md0 UUID=c84d260e:f10d4241:af5e0c24:1f18d143

2. Use the RAID device (i.e., create a logical volume group containing it, put a file system on one of the logical volumes).  This works as expected.

3. Shut down the system.

4. Physically disconnect the /dev/sdc device.  Leave /dev/sdb connected.

5. Boot the system.  /dev/md0 will be assembled and run with the one available component.

6. Use the RAID 1 device.  Activate the logical volume, mount the filesystem from it, and write a file in that file system.

7. Shut down the system.

8. Physically reattach the /dev/sdc device.

9. Boot the system.

10. /dev/md0 will be created with only the /dev/sdb component participating.

11.  sudo mdadm -I --run /dev/sdc1 
  
Actual results:

mdadm: failed to add /dev/sdc1 to /dev/md0: Invalid argument.

Expected results:

/dev/sdc1 to participate in the RAID 1 array, and shown to by synchronizing in results of "cat /proc/mdstat".  If the writes made to the one RAID component were small, the synchronization will be finished before you can observe the synchronization state, and the RAID device will contain both components up to date "[UU]".

Additional info:

This worked as expected in Fedora 14.
Comment 1 Jes Sorensen 2012-01-03 05:33:13 EST
Stephen,

What is the output from mdadm when you try to add the second device?
It has to be more than just 'Invalid argument'

Second, you shouldn't need to add --run when specifying -I, I don't know
if that makes any difference.

Jes
Comment 2 Jes Sorensen 2012-01-03 08:15:21 EST
Stephen,

Ok, I tried reproducing the bug here, and it looks like I am seeing the
exact same as you.

I will try and investigate further.

Jes
Comment 3 Jes Sorensen 2012-01-03 10:33:45 EST
Ok, this is strange.

If I try to add the drive this way:

mdadm -I --run /dev/sdf3

I get the same error as you. On the other hand if I do the following, it
works just fine:

mdadm -a /dev/md42 /dev/sdf3

Looks like something isn't detected correctly by either the kernel or mdadm
when doing an Incremental add. This happens with the latest mdadm from
Neil's git tree and Linus' top of tree kernel as well btw.

Jes
Comment 4 Stephen P. Schaefer 2012-01-04 16:35:50 EST
Thanks for pursuing this and sorry for not responding; I'd been under the weather.  I'll see if the "-a" version does what I need - if the write intent map gets ignored, I end up with a 16 hour sync that needs to finish in a 10 hour window.
Comment 5 Jes Sorensen 2012-01-05 03:43:09 EST
Stephen,

No worries, I've been battling being under the weather myself. I think
you have a genuine bug here, but -a seems to work as a workaround for me.
I think it respects the bitmap, but I would certainly appreciate it if you
can confirm that it does.

I will continue investigating why -I doesn't do the right thing.

Cheers,
Jes
Comment 6 Stephen P. Schaefer 2012-01-05 11:49:28 EST
I'm pleased to report that, with the -a workaround, the write intent map works as hoped.  Thanks,

    - Stephen
Comment 7 Jes Sorensen 2012-01-06 01:32:24 EST
Stephen,

Thanks for confirming this. This means at least the core infrastructure
seems to be working as expected. I'll look into why it doesn't do the
right thing with -I

Cheers,
Jes
Comment 8 Fedora Update System 2012-03-28 11:53:17 EDT
mdadm-3.2.3-7.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/mdadm-3.2.3-7.fc16
Comment 9 Jes Sorensen 2012-03-28 11:56:54 EDT
I have pushed mfadm-3.2.3-7 into updates-testing which should fix this
problem. It solves the problem in my testing.

Please give it a spin and report back.

Thanks,
Jes
Comment 10 Stephen P. Schaefer 2012-03-29 23:54:12 EDT
I pulled the package from http://kojipkgs.fedoraproject.org/packages/mdadm/3.2.3/7.fc16/x86_64/mdadm-3.2.3-7.fc16.x86_64.rpm and it now works as expected for me.  Thanks!
Comment 11 Fedora Update System 2012-03-30 23:13:56 EDT
Package mdadm-3.2.3-7.fc16:
* should fix your issue,
* was pushed to the Fedora 16 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing mdadm-3.2.3-7.fc16'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-5032/mdadm-3.2.3-7.fc16
then log in and leave karma (feedback).
Comment 12 Fedora Update System 2012-04-25 23:25:20 EDT
mdadm-3.2.3-7.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 13 Fedora Update System 2012-05-02 06:16:21 EDT
mdadm-3.2.3-9.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/mdadm-3.2.3-9.fc16
Comment 14 Fedora Update System 2012-05-10 10:52:20 EDT
mdadm-3.2.4-2.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/mdadm-3.2.4-2.fc16
Comment 15 Fedora Update System 2012-05-15 12:43:30 EDT
mdadm-3.2.4-3.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/mdadm-3.2.4-3.fc16
Comment 16 Fedora Update System 2012-05-21 11:15:53 EDT
mdadm-3.2.5-1.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/mdadm-3.2.5-1.fc16
Comment 17 Fedora Update System 2012-06-06 22:53:07 EDT
mdadm-3.2.5-1.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.

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