Bug 769323 - mdadm write intent map not functioning as before
Summary: mdadm write intent map not functioning as before
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: mdadm
Version: 16
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Jes Sorensen
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 791159 807743
TreeView+ depends on / blocked
 
Reported: 2011-12-20 14:09 UTC by Stephen P. Schaefer
Modified: 2012-06-07 02:53 UTC (History)
4 users (show)

Fixed In Version: mdadm-3.2.3-7.fc16
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 791159 807743 (view as bug list)
Environment:
Last Closed: 2012-04-26 03:25:20 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Stephen P. Schaefer 2011-12-20 14:09:03 UTC
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 10:33:13 UTC
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 13:15:21 UTC
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 15:33:45 UTC
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 21:35:50 UTC
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 08:43:09 UTC
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 16:49:28 UTC
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 06:32:24 UTC
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 15:53:17 UTC
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 15:56:54 UTC
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-30 03:54:12 UTC
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-31 03:13:56 UTC
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-26 03:25:20 UTC
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 10:16:21 UTC
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 14:52:20 UTC
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 16:43:30 UTC
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 15:15:53 UTC
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-07 02:53:07 UTC
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.