Bug 737200 - unable to create a redundant logged mirror on a VG with small extents due to invalid dirty region size
Summary: unable to create a redundant logged mirror on a VG with small extents due 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 750882
TreeView+ depends on / blocked
 
Reported: 2011-09-09 21:49 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:
: 750882 (view as bug list)
Environment:
Last Closed: 2011-12-06 17:03:12 UTC


Attachments (Terms of Use)


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

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


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