Bug 477040 - Creation of mirrored logical volume with VG extent-size of 1K fails
Creation of mirrored logical volume with VG extent-size of 1K fails
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: lvm2 (Show other bugs)
5.2
i386 Linux
medium Severity medium
: rc
: ---
Assigned To: Milan Broz
Cluster QE
:
Depends On:
Blocks: 490004
  Show dependency treegraph
 
Reported: 2008-12-18 15:15 EST by Milan Broz
Modified: 2013-02-28 23:07 EST (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 490004 (view as bug list)
Environment:
Last Closed: 2009-09-02 07:57:13 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Milan Broz 2008-12-18 15:15:11 EST
+++ 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 10:31:03 EST
Fixed in upstream cvs in lvm2 2.02.44, planned for inclusion in RHEL5.4.
Comment 2 Milan Broz 2009-05-21 05:22:15 EDT
Fix in version lvm2-2.02.46-1.el5.
Comment 4 Corey Marthaler 2009-05-26 16:14:48 EDT
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 16:37:43 EDT
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 07:57:13 EDT
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.