RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 737125 - unable to create mirror on 1K extent size VG due to dirty region log being too small
Summary: unable to create mirror on 1K extent size VG due to dirty region log being to...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: lvm2
Version: 6.2
Hardware: x86_64
OS: Linux
high
high
Target Milestone: rc
: ---
Assignee: Jonathan Earl Brassow
QA Contact: Corey Marthaler
URL:
Whiteboard:
Depends On:
Blocks: 743047 750613
TreeView+ depends on / blocked
 
Reported: 2011-09-09 16:53 UTC by Corey Marthaler
Modified: 2011-12-06 17:03 UTC (History)
9 users (show)

Fixed In Version: lvm2-2.02.87-3.el6
Doc Type: Bug Fix
Doc Text:
Do not document.
Clone Of:
: 750613 (view as bug list)
Environment:
Last Closed: 2011-12-06 17:03:08 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:1522 0 normal SHIPPED_LIVE lvm2 bug fix and enhancement update 2011-12-06 00:50:10 UTC

Description Corey Marthaler 2011-09-09 16:53:26 UTC
Description of problem:
This is a regression of the following test case:

SCENARIO - [create_mirror_on_1Kextent_vg]
Create a mirror on a VG with an extent size of only 1K
Recreating PVs/VG with smaller (1K) extent size
grant-01: pvcreate --setphysicalvolumesize 1G /dev/sdb1 /dev/sdb2 /dev/sdb3 /dev/sdc1 /dev/sdc2 /dev/sdc3
  Writing physical volume data to disk "/dev/sdb1"
  Writing physical volume data to disk "/dev/sdb2"
  Writing physical volume data to disk "/dev/sdb3"
  Writing physical volume data to disk "/dev/sdc1"
  Writing physical volume data to disk "/dev/sdc2"
  Writing physical volume data to disk "/dev/sdc3"
grant-01: vgcreate -s 1K mirror_sanity /dev/sdb1 /dev/sdb2 /dev/sdb3 /dev/sdc1 /dev/sdc2 /dev/sdc3
grant-01: lvcreate -m 1 -n mirror_on_1Kextent_vg -L 20M mirror_sanity
  device-mapper: reload ioctl failed: Invalid argument
  Failed to activate new LV.
couldn't create mirror on 1K extent VG

device-mapper: dirty region log: log device 253:3 too small: need 1536 bytes
device-mapper: table: 253:6: mirror: Error creating mirror dirty log
device-mapper: ioctl: error adding target to table

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

lvm2-2.02.87-2.el6    BUILT: Fri Sep  9 09:35:36 CDT 2011
lvm2-libs-2.02.87-2.el6    BUILT: Fri Sep  9 09:35:36 CDT 2011
lvm2-cluster-2.02.87-2.el6    BUILT: Fri Sep  9 09:35:36 CDT 2011
udev-147-2.37.el6    BUILT: Wed Aug 10 07:48:15 CDT 2011
device-mapper-1.02.66-2.el6    BUILT: Fri Sep  9 09:35:36 CDT 2011
device-mapper-libs-1.02.66-2.el6    BUILT: Fri Sep  9 09:35:36 CDT 2011
device-mapper-event-1.02.66-2.el6    BUILT: Fri Sep  9 09:35:36 CDT 2011
device-mapper-event-libs-1.02.66-2.el6    BUILT: Fri Sep  9 09:35:36 CDT 2011
cmirror-2.02.87-2.el6    BUILT: Fri Sep  9 09:35:36 CDT 2011


How reproducible:
Everytime

Comment 1 Jonathan Earl Brassow 2011-09-12 22:10:27 UTC
_alloc_init calculates the number of necessary log extents via 'mirror_log_extents'.  'mirror_log_extents' takes 3 arguments: region_size, pe_size, and size of the mirror LV.  Unfortunately, _alloc_init is guessing at the mirror size by using 'ah->new_extents / ah->area_multiple' - the number of extents that the mirror images have.  However, this is /always/ wrong when allocating the log separately.  Further, the log is always allocated separately unless we are up-converting the mirror at the same time.  It was by luck alone that a default value of '1' reflects what we want in most cases.

In order to get a decent value computed, we need to pass in the 'lv' argument to allocate_extents.  This would normally imply a desire for cling/contiguous allocation to the given LV, but since we are not allocating any parallel extents and only log extents, it works fine.

Comment 2 Jonathan Earl Brassow 2011-09-13 14:38:55 UTC
BEFORE:
[root@bp-01 LVM2]# vgs -o name,vg_extent_size vg
  VG   Ext  
  vg   1.00k
[root@bp-01 LVM2]# lvcreate -m1 -L 20M -n lv vg
  device-mapper: reload ioctl failed: Invalid argument
  Failed to activate new LV.


AFTER:
[root@bp-01 LVM2]# vgs -o name,vg_extent_size vg
  VG   Ext  
  vg   1.00k
[root@bp-01 LVM2]# lvcreate -m1 -L 20M -n lv vg
  Logical volume "lv" created
[root@bp-01 LVM2]# lvs -a vg
  LV            VG   Attr     LSize  Poo Origin Snap%  Move Log     Copy%  Convert
  lv            vg   mwi-a-m- 20.00m                        lv_mlog 100.00        
  [lv_mimage_0] vg   iwi-aom- 20.00m                                              
  [lv_mimage_1] vg   iwi-aom- 20.00m                                              
  [lv_mlog]     vg   lwi-aom-  2.00k                                              

Fix checked in upstream in Version 2.02.89.

Comment 3 Jonathan Earl Brassow 2011-09-13 18:44:42 UTC
git commit IDs:
bfd774a20a22f8224a8bc3b507c4564fe6f54fc6 -- original
2d8a2f35c77fdeef1dbe0ef791db8530d07826eb -- follow-up correction

Comment 4 Corey Marthaler 2011-09-14 17:19:27 UTC
I was unable to reproduce this issue with the latest scratch built rpms.

2.6.32-195.el6.x86_64

lvm2-2.02.87-2.1.el6    BUILT: Wed Sep 14 09:44:16 CDT 2011
lvm2-libs-2.02.87-2.1.el6    BUILT: Wed Sep 14 09:44:16 CDT 2011
lvm2-cluster-2.02.87-2.1.el6    BUILT: Wed Sep 14 09:44:16 CDT 2011
udev-147-2.38.el6    BUILT: Fri Sep  9 16:25:50 CDT 2011
device-mapper-1.02.66-2.1.el6    BUILT: Wed Sep 14 09:44:16 CDT 2011
device-mapper-libs-1.02.66-2.1.el6    BUILT: Wed Sep 14 09:44:16 CDT 2011
device-mapper-event-1.02.66-2.1.el6    BUILT: Wed Sep 14 09:44:16 CDT 2011
device-mapper-event-libs-1.02.66-2.1.el6    BUILT: Wed Sep 14 09:44:16 CDT 2011
cmirror-2.02.87-2.1.el6    BUILT: Wed Sep 14 09:44:16 CDT 2011


[root@taft-01 ~]# pvcreate --setphysicalvolumesize 1G /dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sde1 /dev/sdf1 /dev/sdg1
  Writing physical volume data to disk "/dev/sdb1"
  Physical volume "/dev/sdb1" successfully created
  Writing physical volume data to disk "/dev/sdc1"
  Physical volume "/dev/sdc1" successfully created
  Writing physical volume data to disk "/dev/sdd1"
  Physical volume "/dev/sdd1" successfully created
  Writing physical volume data to disk "/dev/sde1"
  Physical volume "/dev/sde1" successfully created
  Writing physical volume data to disk "/dev/sdf1"
  Physical volume "/dev/sdf1" successfully created
  Writing physical volume data to disk "/dev/sdg1"
  Physical volume "/dev/sdg1" successfully created
[root@taft-01 ~]# vgcreate -s 1K mirror_sanity  /dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sde1 /dev/sdf1 /dev/sdg1
  Volume group "mirror_sanity" successfully created
[root@taft-01 ~]# lvcreate -m 1 -n mirror_on_1Kextent_vg -L 20M mirror_sanity
  Logical volume "mirror_on_1Kextent_vg" created

Comment 6 Corey Marthaler 2011-09-26 22:06:01 UTC
Fix verified in the latest official rpms.

2.6.32-198.el6.x86_64

lvm2-2.02.87-3.el6    BUILT: Wed Sep 21 09:54:55 CDT 2011
lvm2-libs-2.02.87-3.el6    BUILT: Wed Sep 21 09:54:55 CDT 2011
lvm2-cluster-2.02.87-3.el6    BUILT: Wed Sep 21 09:54:55 CDT 2011
udev-147-2.38.el6    BUILT: Fri Sep  9 16:25:50 CDT 2011
device-mapper-1.02.66-3.el6    BUILT: Wed Sep 21 09:54:55 CDT 2011
device-mapper-libs-1.02.66-3.el6    BUILT: Wed Sep 21 09:54:55 CDT 2011
device-mapper-event-1.02.66-3.el6    BUILT: Wed Sep 21 09:54:55 CDT 2011
device-mapper-event-libs-1.02.66-3.el6    BUILT: Wed Sep 21 09:54:55 CDT 2011
cmirror-2.02.87-3.el6    BUILT: Wed Sep 21 09:54:55 CDT 2011


SCENARIO - [create_mirror_on_1Kextent_vg]
Create a mirror on a VG with an extent size of only 1K
Recreating PVs/VG with smaller (1K) extent size

taft-01: pvcreate --setphysicalvolumesize 1G /dev/sdd1 /dev/sdd2 /dev/sde1 /dev/sde2 /dev/sdf1 /dev/sdf2 /dev/sdg1 /dev/sdg2 /dev/sdh1 /dev/sdh2

taft-01: vgcreate -s 1K mirror_sanity /dev/sdd1 /dev/sdd2 /dev/sde1 /dev/sde2 /dev/sdf1 /dev/sdf2 /dev/sdg1 /dev/sdg2 /dev/sdh1 /dev/sdh2

taft-01: lvcreate -m 1 -n mirror_on_1Kextent_vg -L 20M mirror_sanity
Deactivating mirror mirror_on_1Kextent_vg... and removing
Restoring VG to default extent size

Comment 7 Peter Rajnoha 2011-10-26 12:59:11 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Do not document.

Comment 8 errata-xmlrpc 2011-12-06 17:03:08 UTC
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.

http://rhn.redhat.com/errata/RHBA-2011-1522.html


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