Bug 848901

Summary: mirrored log redundancy can be compromised when converting from disk -> mirrored log
Product: Red Hat Enterprise Linux 6 Reporter: Corey Marthaler <cmarthal>
Component: lvm2Assignee: Alasdair Kergon <agk>
Status: CLOSED WONTFIX QA Contact: cluster-qe <cluster-qe>
Severity: high Docs Contact:
Priority: low    
Version: 6.3CC: agk, dwysocha, heinzm, jbrassow, msnitzer, prajnoha, prockai, thornber, zkabelac
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-09-29 20:55:50 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Corey Marthaler 2012-08-16 18:22:29 UTC
Description of problem:
Converting from disk log to mirrored log results in both mirror log images being placed on the same device when there are only 1 more devices available then the number of mirror images.

[root@taft-01 ~]# pvscan
  PV /dev/sdd2   VG mirror_sanity   lvm2 [67.83 GiB / 67.63 GiB free]
  PV /dev/sdf1   VG mirror_sanity   lvm2 [67.83 GiB / 67.63 GiB free]
  PV /dev/sde1   VG mirror_sanity   lvm2 [67.83 GiB / 67.82 GiB free]

SCENARIO - [verify_log_image_redundancy_after_conversion]
Create disklog mirror on VG with only three devices and verify mirrored log conversion doesn't lose log image redundancy
Recreating VG with only three PVs

taft-01: lvcreate -m 1 -n mirror_log_convert --mirrorlog disk -L 200M mirror_sanity
  LV                            Attr     LSize   Log                     Copy%  Devices
  mirror_log_convert            mwi-a-m- 200.00m mirror_log_convert_mlog  66.00 mirror_log_convert_mimage_0(0),mirror_log_convert_mimage_1(0)
  [mirror_log_convert_mimage_0] Iwi-aom- 200.00m                                /dev/sdd2(0)
  [mirror_log_convert_mimage_1] Iwi-aom- 200.00m                                /dev/sdf1(0)
  [mirror_log_convert_mlog]     lwi-aom-   4.00m                                /dev/sde1(0)

Convert log from disk to mirrored
taft-01: lvconvert --mirrorlog mirrored mirror_sanity/mirror_log_convert
Verifying that mirror redundancy isn't lost
log convert redundancy issue: both log images are on the same device

  LV                                 Attr     LSize   Log                     Copy%  Devices
  mirror_log_convert                 mwi-a-m- 200.00m mirror_log_convert_mlog 100.00 mirror_log_convert_mimage_0(0),mirror_log_convert_mimage_1(0)          
  [mirror_log_convert_mimage_0]      iwi-aom- 200.00m                                /dev/sdd2(0)
  [mirror_log_convert_mimage_1]      iwi-aom- 200.00m                                /dev/sdf1(0)
  [mirror_log_convert_mlog]          mwi-aom-   4.00m                         100.00 mirror_log_convert_mlog_mimage_0(0),mirror_log_convert_mlog_mimage_1(0)
  [mirror_log_convert_mlog_mimage_0] iwi-aom-   4.00m                                /dev/sde1(0)
  [mirror_log_convert_mlog_mimage_1] iwi-aom-   4.00m                                /dev/sde1(1)



Version-Release number of selected component (if applicable):
2.6.32-279.el6.x86_64

lvm2-2.02.95-10.el6    BUILT: Fri May 18 03:26:00 CDT 2012
lvm2-libs-2.02.95-10.el6    BUILT: Fri May 18 03:26:00 CDT 2012
lvm2-cluster-2.02.95-10.el6    BUILT: Fri May 18 03:26:00 CDT 2012
udev-147-2.41.el6    BUILT: Thu Mar  1 13:01:08 CST 2012
device-mapper-1.02.74-10.el6    BUILT: Fri May 18 03:26:00 CDT 2012
device-mapper-libs-1.02.74-10.el6    BUILT: Fri May 18 03:26:00 CDT 2012
device-mapper-event-1.02.74-10.el6    BUILT: Fri May 18 03:26:00 CDT 2012
device-mapper-event-libs-1.02.74-10.el6    BUILT: Fri May 18 03:26:00 CDT 2012
cmirror-2.02.95-10.el6    BUILT: Fri May 18 03:26:00 CDT 2012

Comment 1 Corey Marthaler 2012-08-17 19:41:54 UTC
There doesn't need to be PVs equal to 1+ the number of mirror images for this to occur. Any time there isn't a free device for the mirrored log conversion, you'll see the same device that the current disk log is on be used when allocating the new mirrored log device.

[root@taft-01 ~]# lvcreate -m 2 -L 100M -n mirror taft
  Logical volume "mirror" created

[root@taft-01 ~]# lvs -a -o +devices
  LV                Attr     LSize   Log         Copy%  Devices
  mirror            mwi-a-m- 100.00m mirror_mlog 100.00 mirror_mimage_0(0),mirror_mimage_1(0),mirror_mimage_2(0)
  [mirror_mimage_0] iwi-aom- 100.00m                    /dev/sdb1(0)
  [mirror_mimage_1] iwi-aom- 100.00m                    /dev/sdc1(0)
  [mirror_mimage_2] iwi-aom- 100.00m                    /dev/sdd1(0)
  [mirror_mlog]     lwi-aom-   4.00m                    /dev/sdd1(25)

[root@taft-01 ~]# lvconvert --mirrorlog mirrored taft/mirror
  Logical volume mirror converted.

[root@taft-01 ~]# lvs -a -o +devices
  LV                     Attr     LSize   Log         Copy%  Devices
  mirror                 mwi-a-m- 100.00m mirror_mlog 100.00 mirror_mimage_0(0),mirror_mimage_1(0),mirror_mimage_2(0)
  [mirror_mimage_0]      iwi-aom- 100.00m                    /dev/sdb1(0)
  [mirror_mimage_1]      iwi-aom- 100.00m                    /dev/sdc1(0)
  [mirror_mimage_2]      iwi-aom- 100.00m                    /dev/sdd1(0)
  [mirror_mlog]          mwi-aom-   4.00m             100.00 mirror_mlog_mimage_0(0),mirror_mlog_mimage_1(0)         
  [mirror_mlog_mimage_0] iwi-aom-   4.00m                    /dev/sdd1(25)
  [mirror_mlog_mimage_1] iwi-aom-   4.00m                    /dev/sdd1(26)

Comment 9 Jonathan Earl Brassow 2017-09-29 20:55:50 UTC
no-one should use 'mirroredlog' redundancy - use the 'raid1' segtype instead.

I'm interested in deprecating this feature all-together:
https://bugzilla.redhat.com/show_bug.cgi?id=1497345