Bug 813948 - DM RAID: Reintegrating RAID1 devices causes fullsync even when partial would do
DM RAID: Reintegrating RAID1 devices causes fullsync even when partial would do
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: kernel (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Jonathan Earl Brassow
Corey Marthaler
Depends On:
  Show dependency treegraph
Reported: 2012-04-18 16:23 EDT by Jonathan Earl Brassow
Modified: 2012-06-20 04:47 EDT (History)
2 users (show)

See Also:
Fixed In Version: kernel-2.6.32-269.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2012-06-20 04:47:43 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2012:0862 normal SHIPPED_LIVE Moderate: Red Hat Enterprise Linux 6 kernel security, bug fix and enhancement update 2012-06-20 08:55:00 EDT

  None (edit)
Description Jonathan Earl Brassow 2012-04-18 16:23:06 EDT
You can split-off RAID1 images temporarily with LVM.  Upon merging back the device into the array, only those changes that have been made to the array need to be sync'ed to the device.  However, a bug is causing the entire device to have to be resynced.

This bug also affect devices that only transiently fail (i.e. go missing for only a short period of time).

to reproduce the issue:
1) lvcreate --type raid1 -m2 -L 5G -n lv vg
2) # Wait for sync
3) lvconvert --splitmirrors 1 --trackchanges vg/lv
4) dd if=/dev/zero of=/dev/vg/lv bs=4M count=1
5) sync
6) lvconvert --merge vg/lv_rimage_2
*) Resync should take a few seconds - not minutes.  (It should be obvious if the entire device is being resynced vs. just the portions that have changed.)
Comment 1 Jonathan Earl Brassow 2012-04-18 16:25:07 EDT
Still iterating upstream over the proper fix....

See comments around patch 5of5:
Comment 2 RHEL Product and Program Management 2012-04-18 16:30:17 EDT
This request was evaluated by Red Hat Product Management for inclusion
in a Red Hat Enterprise Linux maintenance release. Product Management has 
requested further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed 
products. This request is not yet committed for inclusion in an Update release.
Comment 3 Jonathan Earl Brassow 2012-04-18 19:42:22 EDT
Below illustrates the success of the patch.  The script 'test_raid.sh' does the following:
1) create a RAID1 LV
2) wait for sync
3) split a mirror image with --trackchanges
4) writes the displayed amount to the original LV (this is the amount of space that will need to be recovered.)
5) merge the image back into the array
6) display the time taken to resync the changes.

Before the patch, we can see that it doesn't matter how much was written, it takes the full amount of time to resync the device because it always syncs the entire thing.  After the patch, we see that the times for recovery increase with the amount of data that was written before the device was merged back into the array.

Before patch:
[root@bp-01 ~]# ./test_raid.sh 
No I/O

real    0m0.013s
user    0m0.004s
sys     0m0.008s

4M of I/O

real    2m13.611s
user    0m0.292s
sys     0m1.230s

40M of I/O

real    2m12.612s
user    0m0.279s
sys     0m1.264s

400M of I/O

real    2m12.634s
user    0m0.301s
sys     0m1.244s

All I/O (4G)

real    2m16.784s
user    0m0.288s
sys     0m1.349s

After patch:
[root@bp-01 ~]# ./test_raid.sh 
No I/O

real    0m0.013s
user    0m0.005s
sys     0m0.008s

4M of I/O

real    0m1.027s
user    0m0.005s
sys     0m0.019s

40M of I/O

real    0m2.041s
user    0m0.010s
sys     0m0.026s

400M of I/O

real    0m14.187s
user    0m0.032s
sys     0m0.142s

All I/O (4G)

real    2m16.727s
user    0m0.290s
sys     0m1.280s
Comment 4 Jarod Wilson 2012-05-02 12:20:12 EDT
Patch(es) available on kernel-2.6.32-269.el6
Comment 8 Corey Marthaler 2012-06-14 18:25:26 EDT
Marking verified (SanityOnly) based on test results in comment #3.
Comment 10 errata-xmlrpc 2012-06-20 04:47:43 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.


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