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 1005434 - striped raid extension into contiguous space is broken
Summary: striped raid extension into contiguous space is broken
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: lvm2
Version: 6.5
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: rc
: ---
Assignee: Jonathan Earl Brassow
QA Contact: Cluster QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-09-06 22:49 UTC by Corey Marthaler
Modified: 2013-11-21 23:27 UTC (History)
10 users (show)

Fixed In Version: lvm2-2.02.100-4.el6
Doc Type: Bug Fix
Doc Text:
Intra-release bug caused this - no doc text required.
Clone Of:
Environment:
Last Closed: 2013-11-21 23:27:41 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2013:1704 0 normal SHIPPED_LIVE lvm2 bug fix and enhancement update 2013-11-20 21:52:01 UTC

Description Corey Marthaler 2013-09-06 22:49:45 UTC
Description of problem:
In rhel6.4, when you extended a raid[456] volume, it would extend it into contiguous space whenever possible. In rhel6.5 it no longer appears that is the case.

# RHEL6.4

2.6.32-358.18.1.el6.x86_64
lvm2-2.02.98-9.el6    BUILT: Wed Jan 23 17:06:55 CET 2013

[root@virt-012 ~]# lvcreate --type raid4 -i 2 -n contig_space_expand -L 20M raid_sanity /dev/sdb1:0-500 /dev/sdc1:0-500 /dev/sdd1:0-500
  Using default stripesize 64.00 KiB
  Rounding size (5 extents) up to stripe boundary size (6 extents)
  Logical volume "contig_space_expand" created

[root@virt-012 ~]# lvs -a -o +devices
  LV                             Attr      LSize  Cpy%Sync Devices
  contig_space_expand            rwi-a-r-- 24.00m   100.00 contig_space_expand_rimage_0(0),contig_space_expand_rimage_1(0),contig_space_expand_rimage_2(0)
  [contig_space_expand_rimage_0] iwi-aor-- 12.00m          /dev/sdb1(1)
  [contig_space_expand_rimage_1] iwi-aor-- 12.00m          /dev/sdc1(1)
  [contig_space_expand_rimage_2] iwi-aor-- 12.00m          /dev/sdd1(1)
  [contig_space_expand_rmeta_0]  ewi-aor--  4.00m          /dev/sdb1(0)
  [contig_space_expand_rmeta_1]  ewi-aor--  4.00m          /dev/sdc1(0)
  [contig_space_expand_rmeta_2]  ewi-aor--  4.00m          /dev/sdd1(0)

[root@virt-012 ~]# lvextend -L 50M /dev/raid_sanity/contig_space_expand
  Rounding size to boundary between physical extents: 52.00 MiB
  Using stripesize of last segment 64.00 KiB
  Rounding size (13 extents) up to stripe boundary size for segment (14 extents)
  Extending logical volume contig_space_expand to 56.00 MiB
  Logical volume contig_space_expand successfully resized

[root@virt-012 ~]# lvs -a -o +devices
  LV                             Attr      LSize  Cpy%Sync Devices
  contig_space_expand            rwi-a-r-- 56.00m   100.00 contig_space_expand_rimage_0(0),contig_space_expand_rimage_1(0),contig_space_expand_rimage_2(0)
  [contig_space_expand_rimage_0] iwi-aor-- 28.00m          /dev/sdb1(1)
  [contig_space_expand_rimage_1] iwi-aor-- 28.00m          /dev/sdc1(1)
  [contig_space_expand_rimage_2] iwi-aor-- 28.00m          /dev/sdd1(1)
  [contig_space_expand_rmeta_0]  ewi-aor--  4.00m          /dev/sdb1(0)
  [contig_space_expand_rmeta_1]  ewi-aor--  4.00m          /dev/sdc1(0)
  [contig_space_expand_rmeta_2]  ewi-aor--  4.00m          /dev/sdd1(0)



# RHEL6.5
2.6.32-410.el6.x86_64
lvm2-2.02.100-2.el6    BUILT: Wed Aug 14 10:23:33 CDT 2013

[root@taft-01 ~]# lvcreate --type raid4 -i 2 -n contig_space_expand -L 20M raid_sanity /dev/sdb1:0-500 /dev/sdc1:0-500 /dev/sdd1:0-500
  Using default stripesize 64.00 KiB
  Rounding size (5 extents) up to stripe boundary size (6 extents).
  Logical volume "contig_space_expand" created

[root@taft-01 ~]# lvs -a -o +devices
  LV                             Attr       LSize  Cpy%Sync Devices
  contig_space_expand            rwi-a-r--- 24.00m   100.00 contig_space_expand_rimage_0(0),contig_space_expand_rimage_1(0),contig_space_expand_rimage_2(0)
  [contig_space_expand_rimage_0] iwi-aor--- 12.00m          /dev/sdb1(1)
  [contig_space_expand_rimage_1] iwi-aor--- 12.00m          /dev/sdc1(1)
  [contig_space_expand_rimage_2] iwi-aor--- 12.00m          /dev/sdd1(1)
  [contig_space_expand_rmeta_0]  ewi-aor---  4.00m          /dev/sdb1(0)
  [contig_space_expand_rmeta_1]  ewi-aor---  4.00m          /dev/sdc1(0)
  [contig_space_expand_rmeta_2]  ewi-aor---  4.00m          /dev/sdd1(0)

[root@taft-01 ~]# lvextend -L 50M /dev/raid_sanity/contig_space_expand
  Rounding size to boundary between physical extents: 52.00 MiB
  Using stripesize of last segment 64.00 KiB
  Rounding size (13 extents) up to stripe boundary size for segment (14 extents)
  Extending logical volume contig_space_expand to 56.00 MiB
  Logical volume contig_space_expand successfully resized

[root@taft-01 ~]# lvs -a -o +devices
  LV                             Attr       LSize  Cpy%Sync Devices
  contig_space_expand            rwi-a-r--- 56.00m   100.00 contig_space_expand_rimage_0(0),contig_space_expand_rimage_1(0),contig_space_expand_rimage_2(0)
  [contig_space_expand_rimage_0] iwi-aor--- 28.00m          /dev/sdb1(1)
  [contig_space_expand_rimage_0] iwi-aor--- 28.00m          /dev/sdb2(0)  <---
  [contig_space_expand_rimage_1] iwi-aor--- 28.00m          /dev/sdc1(1)
  [contig_space_expand_rimage_1] iwi-aor--- 28.00m          /dev/sdb1(4)  <---
  [contig_space_expand_rimage_2] iwi-aor--- 28.00m          /dev/sdd1(1)
  [contig_space_expand_rimage_2] iwi-aor--- 28.00m          /dev/sdc2(0)  <---
  [contig_space_expand_rmeta_0]  ewi-aor---  4.00m          /dev/sdb1(0)
  [contig_space_expand_rmeta_1]  ewi-aor---  4.00m          /dev/sdc1(0)
  [contig_space_expand_rmeta_2]  ewi-aor---  4.00m          /dev/sdd1(0)

Comment 1 Corey Marthaler 2013-09-06 23:00:40 UTC
FWIW, the mirrored raids (raid1,10) still do the right thing.

Comment 2 Jonathan Earl Brassow 2013-09-24 16:08:18 UTC
Issue doesn't seem to be present in upstream code:
[root@bp-xen-01 ~]# lvcreate --type raid4 -i 2 -L 12M -n lv vg
  Using default stripesize 64.00 KiB
  Rounding size (3 extents) up to stripe boundary size (4 extents).
  Logical volume "lv" created
[root@bp-xen-01 ~]# devices vg
  LV            Attr       Cpy%Sync Devices                                     
  lv            rwi-a-r---   100.00 lv_rimage_0(0),lv_rimage_1(0),lv_rimage_2(0)
  [lv_rimage_0] iwi-aor---          /dev/sda1(1)                                
  [lv_rimage_1] iwi-aor---          /dev/sdb1(1)                                
  [lv_rimage_2] iwi-aor---          /dev/sdc1(1)                                
  [lv_rmeta_0]  ewi-aor---          /dev/sda1(0)                                
  [lv_rmeta_1]  ewi-aor---          /dev/sdb1(0)                                
  [lv_rmeta_2]  ewi-aor---          /dev/sdc1(0)                                
[root@bp-xen-01 ~]# lvextend -L 50M vg/lv
  Rounding size to boundary between physical extents: 52.00 MiB
  Using stripesize of last segment 64.00 KiB
  Rounding size (13 extents) up to stripe boundary size for segment (14 extents)
  Extending logical volume lv to 56.00 MiB
  Logical volume lv successfully resized
[root@bp-xen-01 ~]# devices vg
  LV            Attr       Cpy%Sync Devices                                     
  lv            rwi-a-r---   100.00 lv_rimage_0(0),lv_rimage_1(0),lv_rimage_2(0)
  [lv_rimage_0] iwi-aor---          /dev/sda1(1)                                
  [lv_rimage_1] iwi-aor---          /dev/sdb1(1)                                
  [lv_rimage_2] iwi-aor---          /dev/sdc1(1)                                
  [lv_rmeta_0]  ewi-aor---          /dev/sda1(0)                                
  [lv_rmeta_1]  ewi-aor---          /dev/sdb1(0)                                
  [lv_rmeta_2]  ewi-aor---          /dev/sdc1(0)                                
[root@bp-xen-01 ~]# lvs vg
  LV   VG   Attr       LSize  Pool Origin Data%  Move Log Cpy%Sync Convert
  lv   vg   rwi-a-r--- 56.00m                               100.00

Comment 3 Jonathan Earl Brassow 2013-09-24 16:12:23 UTC
(In reply to Corey Marthaler from comment #0)
> Description of problem:
> In rhel6.4, when you extended a raid[456] volume, it would extend it into
> contiguous space whenever possible. In rhel6.5 it no longer appears that is
> the case.

<snip>
 
> [root@taft-01 ~]# lvs -a -o +devices
>   LV                             Attr       LSize  Cpy%Sync Devices
>   contig_space_expand            rwi-a-r--- 56.00m   100.00
> contig_space_expand_rimage_0(0),contig_space_expand_rimage_1(0),
> contig_space_expand_rimage_2(0)
>   [contig_space_expand_rimage_0] iwi-aor--- 28.00m          /dev/sdb1(1)
>   [contig_space_expand_rimage_0] iwi-aor--- 28.00m          /dev/sdb2(0) 
> <---
>   [contig_space_expand_rimage_1] iwi-aor--- 28.00m          /dev/sdc1(1)
>   [contig_space_expand_rimage_1] iwi-aor--- 28.00m          /dev/sdb1(4) 
> <---
>   [contig_space_expand_rimage_2] iwi-aor--- 28.00m          /dev/sdd1(1)
>   [contig_space_expand_rimage_2] iwi-aor--- 28.00m          /dev/sdc2(0) 
> <---
>   [contig_space_expand_rmeta_0]  ewi-aor---  4.00m          /dev/sdb1(0)
>   [contig_space_expand_rmeta_1]  ewi-aor---  4.00m          /dev/sdc1(0)
>   [contig_space_expand_rmeta_2]  ewi-aor---  4.00m          /dev/sdd1(0)

What's worse, is that redundancy is lost.

I still have yet to reproduce this though.

Comment 4 Jonathan Earl Brassow 2013-09-24 19:19:22 UTC
Just tried the latest RHEL6.5 tree.  Seems to work fine there also.  I am using a bit newer kernel and RPMs though.  Please re-try.

[root@bp-xen-01 ~]# uname -a
Linux bp-xen-01 2.6.32-419.el6.x86_64 #1 SMP Thu Sep 12 11:11:01 EDT 2013 x86_64 x86_64 x86_64 GNU/Linux
[root@bp-xen-01 ~]# rpm -q lvm2
lvm2-2.02.100-3.el6.x86_64

[root@bp-xen-01 ~]# lvcreate --type raid4 -i 2 -L 20M -n lv vg
  Using default stripesize 64.00 KiB
  Rounding size (5 extents) up to stripe boundary size (6 extents).
  Logical volume "lv" created
[root@bp-xen-01 ~]# devices vg
  LV            Attr       Cpy%Sync Devices                                     
  lv            rwi-a-r---   100.00 lv_rimage_0(0),lv_rimage_1(0),lv_rimage_2(0)
  [lv_rimage_0] iwi-aor---          /dev/sda1(1)                                
  [lv_rimage_1] iwi-aor---          /dev/sdb1(1)                                
  [lv_rimage_2] iwi-aor---          /dev/sdc1(1)                                
  [lv_rmeta_0]  ewi-aor---          /dev/sda1(0)                                
  [lv_rmeta_1]  ewi-aor---          /dev/sdb1(0)                                
  [lv_rmeta_2]  ewi-aor---          /dev/sdc1(0)                                
[root@bp-xen-01 ~]# lvextend -L 50M vg/lv
  Rounding size to boundary between physical extents: 52.00 MiB
  Using stripesize of last segment 64.00 KiB
  Rounding size (13 extents) up to stripe boundary size for segment (14 extents)
  Extending logical volume lv to 56.00 MiB
  Logical volume lv successfully resized
[root@bp-xen-01 ~]# devices vg
  LV            Attr       Cpy%Sync Devices                                     
  lv            rwi-a-r---   100.00 lv_rimage_0(0),lv_rimage_1(0),lv_rimage_2(0)
  [lv_rimage_0] iwi-aor---          /dev/sda1(1)                                
  [lv_rimage_1] iwi-aor---          /dev/sdb1(1)                                
  [lv_rimage_2] iwi-aor---          /dev/sdc1(1)                                
  [lv_rmeta_0]  ewi-aor---          /dev/sda1(0)                                
  [lv_rmeta_1]  ewi-aor---          /dev/sdb1(0)                                
  [lv_rmeta_2]  ewi-aor---          /dev/sdc1(0)

Comment 5 Jonathan Earl Brassow 2013-09-24 19:33:33 UTC
just reproduced.  It required putting the RAID on PVs that would normally come later in the group.

[root@bp-xen-01 ~]# !lvcre
lvcreate --type raid4 -i 2 -L 20M -n lv vg /dev/sd[efg]1
  Using default stripesize 64.00 KiB
  Rounding size (5 extents) up to stripe boundary size (6 extents).
  Logical volume "lv" created
[root@bp-xen-01 ~]# devices vg
  LV            Attr       Cpy%Sync Devices                                     
  lv            rwi-a-r---   100.00 lv_rimage_0(0),lv_rimage_1(0),lv_rimage_2(0)
  [lv_rimage_0] iwi-aor---          /dev/sde1(1)                                
  [lv_rimage_1] iwi-aor---          /dev/sdf1(1)                                
  [lv_rimage_2] iwi-aor---          /dev/sdg1(1)                                
  [lv_rmeta_0]  ewi-aor---          /dev/sde1(0)                                
  [lv_rmeta_1]  ewi-aor---          /dev/sdf1(0)                                
  [lv_rmeta_2]  ewi-aor---          /dev/sdg1(0)                                
[root@bp-xen-01 ~]# lvextend -L 40M vg/lv  Using stripesize of last segment 64.00 KiB
  Extending logical volume lv to 40.00 MiB
  Logical volume lv successfully resized
[root@bp-xen-01 ~]# devices vg
  LV            Attr       Cpy%Sync Devices                                     
  lv            rwi-a-r---   100.00 lv_rimage_0(0),lv_rimage_1(0),lv_rimage_2(0)
  [lv_rimage_0] iwi-aor---          /dev/sde1(1)                                
  [lv_rimage_0] iwi-aor---          /dev/sda1(0)                                
  [lv_rimage_1] iwi-aor---          /dev/sdf1(1)                                
  [lv_rimage_1] iwi-aor---          /dev/sdb1(0)                                
  [lv_rimage_2] iwi-aor---          /dev/sdg1(1)                                
  [lv_rimage_2] iwi-aor---          /dev/sdc1(0)                                
  [lv_rmeta_0]  ewi-aor---          /dev/sde1(0)                                
  [lv_rmeta_1]  ewi-aor---          /dev/sdf1(0)                                
  [lv_rmeta_2]  ewi-aor---          /dev/sdg1(0)

Comment 7 Jonathan Earl Brassow 2013-09-25 02:36:55 UTC
Fix committed upstream (2 commits):
commit c37c59e155813545c2e674eb370a4609e97aa769
Author: Jonathan Brassow <jbrassow>
Date:   Tue Sep 24 21:32:53 2013 -0500

    Test/clean-up: Indent clean-up and additional RAID resize test
    
    Better indenting and a test for bug 1005434 (parity RAID should
    extend in a contiguous fashion).

commit 5ded7314ae00629da8d21d925c3fa091cce2a939
Author: Jonathan Brassow <jbrassow>
Date:   Tue Sep 24 21:32:10 2013 -0500

    RAID: Fix broken allocation policies for parity RAID types
    
    A previous commit (b6bfddcd0a830d0c9312bc3ab906cb3d1b7a6dd9) which
    was designed to prevent segfaults during lvextend when trying to
    extend striped logical volumes forgot to include calculations for
    RAID4/5/6 parity devices.  This was causing the 'contiguous' and
    'cling_by_tags' allocation policies to fail for RAID 4/5/6.
    
    The solution is to remember that while we can compare
        ah->area_count == prev_lvseg->area_count
    for non-RAID, we should compare
        (ah->area_count + ah->parity_count) == prev_lvseg->area_count
    for a general solution.

Comment 10 Corey Marthaler 2013-09-30 13:07:22 UTC
Fix verified in the latest official rpms.

2.6.32-410.el6.x86_64
lvm2-2.02.100-4.el6    BUILT: Fri Sep 27 09:05:32 CDT 2013
lvm2-libs-2.02.100-4.el6    BUILT: Fri Sep 27 09:05:32 CDT 2013
lvm2-cluster-2.02.100-4.el6    BUILT: Fri Sep 27 09:05:32 CDT 2013
udev-147-2.48.el6    BUILT: Fri Aug  9 06:09:50 CDT 2013
device-mapper-1.02.79-4.el6    BUILT: Fri Sep 27 09:05:32 CDT 2013
device-mapper-libs-1.02.79-4.el6    BUILT: Fri Sep 27 09:05:32 CDT 2013
device-mapper-event-1.02.79-4.el6    BUILT: Fri Sep 27 09:05:32 CDT 2013
device-mapper-event-libs-1.02.79-4.el6    BUILT: Fri Sep 27 09:05:32 CDT 2013
cmirror-2.02.100-4.el6    BUILT: Fri Sep 27 09:05:32 CDT 2013


SCENARIO (raid1) - [extend_raid_into_contig_space_on_both_legs]
Create a raid with free contiguous space on both leg devices for expansion,
do the expansion, and verify the expansion took place on contiguous devices
taft-01: lvcreate --type raid1 -m 1 -n contig_space_expand -L 20M raid_sanity /dev/sde2:0-500 /dev/sdb2:0-500
Extending raid /dev/raid_sanity/contig_space_expand
lvextend -L 50M /dev/raid_sanity/contig_space_expand
Verifying that the size increased
Verifing that the raid is still laid out so that each leg expansion continues on the proper device
/dev/sde2 should be on /dev/sde2
/dev/sdb2 should be on /dev/sdb2

perform raid scrubbing (--syncaction check) on raid contig_space_expand
  raid_sanity/contig_space_expand state is currently "resync".  Unable to switch to "check".
Waiting until all mirror|raid volumes become fully syncd...
   1/1 mirror(s) are fully synced: ( 100.00% )

Deactivating raid contig_space_expand... and removing

Comment 11 Corey Marthaler 2013-09-30 13:10:57 UTC
Comment 10 should have been tested on striped raid:

SCENARIO (raid4) - [extend_raid_into_contig_space_on_both_legs]
Create a raid with free contiguous space on both leg devices for expansion,
do the expansion, and verify the expansion took place on contiguous devices
taft-01: lvcreate --type raid4 -i 2 -n contig_space_expand -L 20M raid_sanity /dev/sdf1:0-500 /dev/sdb2:0-500 /dev/sdd2:0-500
Extending raid /dev/raid_sanity/contig_space_expand
lvextend -L 50M /dev/raid_sanity/contig_space_expand
Verifying that the size increased
Verifing that the raid is still laid out so that each leg expansion continues on the proper device
/dev/sdf1 should be on /dev/sdf1
/dev/sdb2 should be on /dev/sdb2
/dev/sdd2 should be on /dev/sdd2

perform raid scrubbing (--syncaction check) on raid contig_space_expand
Waiting until all mirror|raid volumes become fully syncd...
   1/1 mirror(s) are fully synced: ( 100.00% )

Deactivating raid contig_space_expand... and removing

Comment 12 errata-xmlrpc 2013-11-21 23:27:41 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-2013-1704.html


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