Bug 204127 - lvconvert must honor allocation policy
lvconvert must honor allocation policy
Status: CLOSED DEFERRED
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: lvm2 (Show other bugs)
4.4
All Linux
medium Severity medium
: rc
: ---
Assigned To: Milan Broz
:
Depends On:
Blocks: 221891 233105
  Show dependency treegraph
 
Reported: 2006-08-25 14:34 EDT by Jun'ichi Nomura (Red Hat)
Modified: 2013-02-28 23:04 EST (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-03-05 08:03:37 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Reproducer test script (1.62 KB, application/x-shellscript)
2006-08-25 14:34 EDT, Jun'ichi Nomura (Red Hat)
no flags Details
Reproducer test script (2.68 KB, application/x-sh)
2007-01-08 15:42 EST, Jun'ichi NOMURA
no flags Details

  None (edit)
Description Jun'ichi Nomura (Red Hat) 2006-08-25 14:34:54 EDT
Description of problem:
lvconvert from corelog to disklog allocates log device
from the same PV where mirror image resides

Version-Release number of selected component:
lvm2-2.02.06-6.0.RHEL4

How reproducible:
Always

Steps to Reproduce:
 1. Create a VG with 3 or more PVs
      # vgcreate testvg /dev/sdb[1-3]
 2. Create a mirrored LV with corelog
      # lvcreate -m1 --corelog -l1 -nlv0 testvg
 3. Convert it to disklog
      # lvconvert -m1 testvg/lv0
 4. Check what consists of the LV
      # lvs -a -o+devices

Actual results:
  Mirror image and log shares the same PV.

  LV             Devices
  lv0            lv0_mimage_0(0),lv0_mimage_1(0)
  [lv0_mimage_0] /dev/sdb1(0)
  [lv0_mimage_1] /dev/sdb2(0)
  [lv0_mlog]     /dev/sdb2(1)

Expected results:
  Mirror images and log use different PVs.

  LV             Devices
  lv0            lv0_mimage_0(0),lv0_mimage_1(0)
  [lv0_mimage_0] /dev/sdb1(0)
  [lv0_mimage_1] /dev/sdb2(0)
  [lv0_mlog]     /dev/sdb3(0)

Additional info:

Attached script does the above steps and show what happens.

# sh lvconvert-corelog.sh
INFO: Creating a file for loop setup. file=tmpfile
122880+0 records in
122880+0 records out
INFO: Setting up loop device. dev=/dev/loop0 file=tmpfile
INFO: Creating PV. nr_pv=3
  Physical volume "/dev/mapper/pv0" successfully created
  Physical volume "/dev/mapper/pv1" successfully created
  Physical volume "/dev/mapper/pv2" successfully created
INFO: Creating VG. nr_vg=1. each pv in a vg: 3
INFO: vgname=testvg0
  Volume group "testvg0" successfully created
INFO: Create mirrored LV with corelog.
  Logical volume "lv0" created
  LV             Devices
  lv0            lv0_mimage_0(0),lv0_mimage_1(0)
  [lv0_mimage_0] /dev/dm-0(0)
  [lv0_mimage_1] /dev/dm-1(0)
INFO: Convert the LV to disklog.
  Logical volume lv0 converted.
  LV             Devices
  lv0            lv0_mimage_0(0),lv0_mimage_1(0)
  [lv0_mimage_0] /dev/dm-0(0)
  [lv0_mimage_1] /dev/dm-1(0)
  [lv0_mlog]     /dev/dm-1(1)
INFO: Cleaning up.
Comment 1 Jun'ichi Nomura (Red Hat) 2006-08-25 14:34:55 EDT
Created attachment 134949 [details]
Reproducer test script
Comment 2 Jonathan Earl Brassow 2006-09-08 16:01:45 EDT
Changed title to reflect real problem.

The default allocation policy requires mirror images and log device to go on
distinct devices.  If the allocation policy is 'anywhere', the mirror images
must be on distinct devices, but the log device can go anywhere.  When
up-converting, lvconvert behaves as though the allocation policy is 'anywhere'.
Comment 3 Jun'ichi NOMURA 2006-09-22 18:37:32 EDT
Patch and test case posted on linux-lvm:
https://www.redhat.com/archives/linux-lvm/2006-September/msg00108.html
Comment 4 Jun'ichi NOMURA 2006-09-22 18:43:25 EDT
This patch should also be necessary to support the patches in comment #3
https://www.redhat.com/archives/linux-lvm/2006-August/msg00116.html
Comment 6 Jonathan Earl Brassow 2007-01-08 15:06:42 EST
The patches work.
Comment 7 Jun'ichi NOMURA 2007-01-08 15:42:59 EST
Created attachment 145103 [details]
Reproducer test script

What this script does:
  1. Create loop-back device and dummy PVs on top of it
  2. Create VG named "testvg" on it
  3. lvcreate --corelog -m1
      The each leg of the created mirror LV spans multiple PVs.
  4. lvconvert -m1
  5. Check the redundancy

How to run:

# sh testcase-lvconvert-addlog-multiseg.sh 
  PV /dev/dm-7	  VG testvg   lvm2 [196.00 MB / 0    free]
  PV /dev/dm-8	  VG testvg   lvm2 [196.00 MB / 0    free]
  PV /dev/dm-9	  VG testvg   lvm2 [196.00 MB / 100.00 MB free]
  PV /dev/dm-10   VG testvg   lvm2 [196.00 MB / 96.00 MB free]
  PV /dev/dm-11   VG testvg   lvm2 [196.00 MB / 196.00 MB free]
  PV /dev/dm-12   VG testvg   lvm2 [196.00 MB / 196.00 MB free]
  PV /dev/dm-13   VG testvg   lvm2 [196.00 MB / 196.00 MB free]
  Total: 11 [19.03 GB] / in use: 9 [11.43 GB] / in no VG: 2 [7.60 GB]
  VG	 #PV #LV #SN Attr   VSize VFree  
  testvg   7   4   0 wz--n- 1.34G 784.00M
  VG	 #PV #LV #SN Attr   VSize VFree  
  testvg   7   4   0 wz--n- 1.34G 784.00M
  Logical volume "lv" successfully removed
INFO: PE count of PV is 49.
  /dev/dm-10 testvg lvm2 a-   196.00M 196.00M
  /dev/dm-11 testvg lvm2 a-   196.00M 196.00M
  /dev/dm-12 testvg lvm2 a-   196.00M 196.00M
  /dev/dm-13 testvg lvm2 a-   196.00M 196.00M
  /dev/dm-7  testvg lvm2 a-   196.00M 196.00M
  /dev/dm-8  testvg lvm2 a-   196.00M 196.00M
  /dev/dm-9  testvg lvm2 a-   196.00M 196.00M
INFO: Create mirror LV with each legs spanning multiple PVs.
  Logical volume "lv" created
  LV		Devices 		      
  lv		lv_mimage_0(0),lv_mimage_1(0) 
  [lv_mimage_0] /dev/dm-7(0)		      
  [lv_mimage_0] /dev/dm-9(0)		      
  [lv_mimage_1] /dev/dm-8(0)		      
  [lv_mimage_1] /dev/dm-10(0)		      
INFO: Convert the LV to disklog.
  Logical volume lv converted.
  LV		Devices 		      
  lv		lv_mimage_0(0),lv_mimage_1(0) 
  [lv_mimage_0] /dev/dm-7(0)		      
  [lv_mimage_0] /dev/dm-9(0)		      
  [lv_mimage_1] /dev/dm-8(0)		      
  [lv_mimage_1] /dev/dm-10(0)		      
  [lv_mlog]	/dev/dm-10(24)		      
ERROR: /dev/dm-10 is used in both testvg/lv_mlog and testvg/lv_mimage_1
ERROR: /dev/dm-10 is used in both testvg/lv_mimage_1 and testvg/lv_mlog
Number of failures: 2
FAIL
Comment 13 RHEL Product and Program Management 2007-03-09 19:57:47 EST
This bugzilla had previously been approved for engineering
consideration but Red Hat Product Management is currently reevaluating
this issue for inclusion in RHEL4.6.
Comment 19 RHEL Product and Program Management 2008-09-05 13:19:24 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 21 Milan Broz 2009-03-05 08:03:37 EST
The needed patch is still not upstream, moving the development tracking to RHEL5 bug 221891.

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