Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 737200

Summary: unable to create a redundant logged mirror on a VG with small extents due to invalid dirty region size
Product: Red Hat Enterprise Linux 6 Reporter: Corey Marthaler <cmarthal>
Component: lvm2Assignee: Jonathan Earl Brassow <jbrassow>
Status: CLOSED ERRATA QA Contact: Corey Marthaler <cmarthal>
Severity: high Docs Contact:
Priority: high    
Version: 6.2CC: agk, dwysocha, heinzm, jbrassow, mbroz, prajnoha, prockai, thornber, zkabelac
Target Milestone: rcKeywords: Regression, TestBlocker
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: lvm2-2.02.87-3.el6 Doc Type: Bug Fix
Doc Text:
Do not document.
Story Points: ---
Clone Of:
: 750882 (view as bug list) Environment:
Last Closed: 2011-12-06 17:03:12 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 743047, 750882    

Description Corey Marthaler 2011-09-09 21:49:41 UTC
Description of problem:
This is a regression of the following test case (and my be related to bug 737125):

SCENARIO - [redundant_log_on_small_extent_vg]
Create a redundant logged mirror on a VG with small extents
Recreating VG with smaller (256K) extent size
taft-01: vgcreate -s 256k mirror_sanity /dev/sdc1 /dev/sdd1 /dev/sde1 /dev/sdf1 /dev/sdg1 /dev/sdh1
taft-01: lvcreate -n mirrored_log_on_256kextent_vg -L 200M -m 1 --mirrorlog mirrored mirror_sanity
  device-mapper: reload ioctl failed: Invalid argument
  Aborting. Failed to activate mirror log.
  Failed to initialise mirror log.
couldn't create mirror on small extent VG

device-mapper: dirty region log: invalid region size 1024
device-mapper: table: 253:5: 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.bz735124.1.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 Corey Marthaler 2011-09-09 21:53:09 UTC
FWIW, the following dm devices are created during the failed mirror create attempt.

[root@taft-01 ~]# dmsetup ls
mirror_sanity-mirrored_log_on_256kextent_vg_mlog_mimage_1       (253, 4)
mirror_sanity-mirrored_log_on_256kextent_vg_mlog_mimage_0       (253, 3)
mirror_sanity-mirrored_log_on_256kextent_vg_mlog        (253, 5)

Comment 5 Jonathan Earl Brassow 2011-09-12 22:15:42 UTC
Once 737125 is eliminated, this problem remains.  It is due to the fact that the kernel also imposes this restriction on mirrors:

static int _check_region_size(struct dm_target *ti, uint32_t region_size)
{
        if (region_size < 2 || region_size > ti->len)
                return 0;

        if (!is_power_of_2(region_size))
                return 0;

        return 1;
}

Specifically, that the region_size be less than the length of the target.  The mirror log is extremely small - normally 4MiB w/ 512kiB region_size.  However, with the pe_size setting in this bug, we get a 2kiB log with 512kiB region_size.  The region_size will have to be adjusted to the power of 2 that is less than the size of the log.

Comment 6 Jonathan Earl Brassow 2011-09-13 15:01:07 UTC
The other (and easier solution) is to make the log at least the size of a region.  This may cause the log to be larger than it would otherwise have to be, but this will not happen when PE sizes are normal.

Comment 7 Jonathan Earl Brassow 2011-09-13 18:44:06 UTC
Solution in comment 6 checked in upstream in Version 2.02.89

Comment 8 Jonathan Earl Brassow 2011-09-13 19:50:22 UTC
git commit ID:
39feace42ecc87743b42a0ff46ebc9718502774e

Comment 9 Jonathan Earl Brassow 2011-09-13 19:54:57 UTC
proof of solution...

[root@bp-01 ~]# !vgs
vgs -o name,vg_extent_size vg
  VG   Ext  
  vg   1.00k
[root@bp-01 ~]# lvcreate -m 1 --mirrorlog mirrored -L 20M -n lv vg
  Logical volume "lv" created
[root@bp-01 ~]# lvs -a -o name,size vg
  LV                 LSize  
  lv                  20.00m
  [lv_mimage_0]       20.00m
  [lv_mimage_1]       20.00m
  [lv_mlog]          512.00k
  [lv_mlog_mimage_0] 512.00k
  [lv_mlog_mimage_1] 512.00k

Comment 10 Corey Marthaler 2011-09-15 16:12:24 UTC
I no longer see this issue either on the latest scratch built rpms.

============================================================
Iteration 10 of 10 started at Thu Sep 15 11:05:25 CDT 2011
============================================================
SCENARIO - [redundant_log_on_small_extent_vg]
Create a redundant logged mirror on a VG with small extents
Recreating VG with smaller (256K) extent size
taft-01: vgcreate -s 256k mirror_sanity /dev/sdc1 /dev/sdd1 /dev/sde1 /dev/sdf1 /dev/sdg1 /dev/sdh1
taft-01: lvcreate -n mirrored_log_on_256kextent_vg -L 200M -m 1 --mirrorlog mirrored mirror_sanity
Deactivating mirror mirrored_log_on_256kextent_vg... and removing
Restoring VG to default extent size

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

Comment 12 Corey Marthaler 2011-09-26 22:09:11 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 - [redundant_log_on_small_extent_vg]
Create a redundant logged mirror on a VG with small extents
Recreating VG with smaller (256K) extent size
taft-01: vgcreate -s 256k 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 -n mirrored_log_on_256kextent_vg -L 200M -m 1 --mirrorlog mirrored mirror_sanity
Deactivating mirror mirrored_log_on_256kextent_vg... and removing
Restoring VG to default extent size

Comment 13 Peter Rajnoha 2011-10-26 13:00:01 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 14 errata-xmlrpc 2011-12-06 17:03:12 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