Bug 477040 - Creation of mirrored logical volume with VG extent-size of 1K fails
Summary: Creation of mirrored logical volume with VG extent-size of 1K fails
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: lvm2
Version: 5.2
Hardware: i386
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Milan Broz
QA Contact: Cluster QE
URL:
Whiteboard:
Depends On:
Blocks: 490004
TreeView+ depends on / blocked
 
Reported: 2008-12-18 20:15 UTC by Milan Broz
Modified: 2013-03-01 04:07 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 490004 (view as bug list)
Environment:
Last Closed: 2009-09-02 11:57:13 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2009:1393 0 normal SHIPPED_LIVE lvm2 bug-fix and enhancement update 2009-09-01 12:00:22 UTC

Description Milan Broz 2008-12-18 20:15:11 UTC
+++ This bug was initially created as a clone of Bug #471565 +++

Usespace part, lvm2 need calculate properly sized log device

Description of problem:
Creation of a mirrored LV with disk log fails, if the VG extent-size is 1K (2K and bigger works as expected).


Version-Release number of selected component (if applicable):
$ lvm version
  LVM version:     2.02.32-RHEL5 (2008-03-04)
  Library version: 1.02.24 (2007-12-20)
  Driver version:  4.11.5 


How reproducible:
Create a volume group with extent size of 1K and a mirrored logical volume with a disk based mirror log.


Steps to Reproduce:
$ dd if=/dev/zero of=/test/image[1,2,3] bs=1024k count=128
$ losetup /dev/loop0 /test/image1
$ losetup /dev/loop1 /test/image2
$ losetup /dev/loop2 /test/image3
$ pvcreate /dev/loop[0,1,2]
  Physical volume "/dev/loop[0,1,2]" successfully created
$ vgcreate -s 1K vg_mirror_test /dev/loop0 /dev/loop1 /dev/loop2
  Volume group "vg_mirror_test" successfully created
$ lvcreate -L 64M -m 1 -n lv_mirror1 vg_mirror_test /dev/loop0 /dev/loop1 /dev/loop2:0-0
  /dev/cdrom: open failed: Read-only file system
 
No more output shown.

  
Actual results:
dmesg and /var/log/messages shows this:
 
===
Nov  4 17:43:17 nagtest-web1 lvm[16895]: Log device, 253:2, has failed.  
Nov  4 17:43:17 nagtest-web1 lvm[16895]: Device failure in vg_mirror_test-lv_mirror1
Nov  4 17:43:17 nagtest-web1 lvm[16895]: WARNING: dev_open(/etc/lvm/lvm.conf) called while suspended
Nov  4 17:43:16 nagtest-web1 kernel: attempt to access beyond end of device
Nov  4 17:43:22 nagtest-web1 kernel: dm-2: rw=16, want=3, limit=2
Nov  4 17:43:22 nagtest-web1 kernel: device-mapper: mirror log: Failed to read header on mirror log device, 253:2
Nov  4 17:43:22 nagtest-web1 kernel: attempt to access beyond end of device
Nov  4 17:43:22 nagtest-web1 kernel: dm-2: rw=17, want=3, limit=2
Nov  4 17:43:22 nagtest-web1 kernel: device-mapper: mirror log: Failed to write header on mirror log device, 253:2
Nov  4 17:43:22 nagtest-web1 kernel: device-mapper: raid1: log resume failed
Nov  4 17:43:22 nagtest-web1 kernel: attempt to access beyond end of device
Nov  4 17:43:22 nagtest-web1 kernel: dm-2: rw=17, want=3, limit=2
Nov  4 17:43:22 nagtest-web1 kernel: attempt to access beyond end of device
Nov  4 17:43:22 nagtest-web1 kernel: dm-2: rw=17, want=3, limit=2
Nov  4 17:43:22 nagtest-web1 kernel: attempt to access beyond end of device
===
'top' lists the kmirrord process with high cpu utilization:
PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
5541 root      20  -5     0    0    0 R 95.9  0.0  12:30.75 kmirrord
===
 
The errors continue forever ...
It seems that a 1K mirror log (because the size of the mirror log is equal to the size of the VG phsical extend) isn't big enough to hold the log information!


Expected results:
$ lvcreate -L 64M -m 1 -n lv_mirror1 vg_mirror_test /dev/loop0 /dev/loop1 /dev/loop2:0-0
  /dev/cdrom: open failed: Read-only file system
  Logical volume "lv_mirror1" created

Comment 1 Milan Broz 2008-12-19 15:31:03 UTC
Fixed in upstream cvs in lvm2 2.02.44, planned for inclusion in RHEL5.4.

Comment 2 Milan Broz 2009-05-21 09:22:15 UTC
Fix in version lvm2-2.02.46-1.el5.

Comment 4 Corey Marthaler 2009-05-26 20:14:48 UTC
Fix verified in lvm2-2.02.46-2.el5.

[root@grant-03 ~]# vgcreate -s 1K grant /dev/sdb1 /dev/sdb2 /dev/sdb3 
  Volume group "grant" successfully created

[root@grant-03 ~]# lvcreate -L 64M -m 1 -n mirror grant 
  Logical volume "mirror" created

[root@grant-03 ~]# lvs -a -o +devices
  LV                VG         Attr   LSize  Origin Snap%  Move Log         Copy%  Convert Devices                              
  LogVol00          VolGroup00 -wi-ao 64.56G                                               /dev/sda2(0)                         
  LogVol01          VolGroup00 -wi-ao  9.81G                                               /dev/sda2(2066)                      
  mirror            grant      mwi-a- 64.00M                    mirror_mlog 100.00         mirror_mimage_0(0),mirror_mimage_1(0)
  [mirror_mimage_0] grant      iwi-ao 64.00M                                               /dev/sdb2(0)                         
  [mirror_mimage_1] grant      iwi-ao 64.00M                                               /dev/sdb3(0)                         
  [mirror_mlog]     grant      lwi-ao  2.00K                                               /dev/sdb1(0)

Comment 5 Corey Marthaler 2009-05-26 20:37:43 UTC
Just a note, this was verified w/o specifying the disks on the lvcreate cmdline. When specifying the disks and allowing 0 space for the log on a 1K extent VG, you'll end up hitting bug 502671.

Comment 7 errata-xmlrpc 2009-09-02 11:57:13 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2009-1393.html


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