Bug 1354650 - raid0 needs a default stripe number
Summary: raid0 needs a default stripe number
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: lvm2
Version: 7.3
Hardware: x86_64
OS: Linux
unspecified
low
Target Milestone: rc
: ---
Assignee: Heinz Mauelshagen
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-07-11 20:47 UTC by Corey Marthaler
Modified: 2016-11-04 04:15 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-04 04:15:36 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:1445 normal SHIPPED_LIVE lvm2 bug fix and enhancement update 2016-11-03 13:46:41 UTC

Description Corey Marthaler 2016-07-11 20:47:33 UTC
Description of problem:
All other raid types have a default.

[root@host-082 ~]# lvcreate --type raid1 -L 100M test
  Logical volume "lvol0" created.

[root@host-082 ~]# lvcreate --type raid4 -L 100M test
  Rounding size 100.00 MiB (25 extents) up to stripe boundary size 112.00 MiB (28 extents).
  Logical volume "lvol1" created.

[root@host-082 ~]# lvcreate --type raid5 -L 100M test
  Rounding size 100.00 MiB (25 extents) up to stripe boundary size 112.00 MiB (28 extents).
  Logical volume "lvol2" created.

[root@host-082 ~]# lvcreate --type raid6 -L 100M test
  Rounding size 100.00 MiB (25 extents) up to stripe boundary size 120.00 MiB (30 extents).
WARNING: ext2 signature detected on /dev/test/lvol3 at offset 1080. Wipe it? [y/n]: y
  Wiping ext2 signature on /dev/test/lvol3.
  Logical volume "lvol3" created.

[root@host-082 ~]# lvcreate --type raid10 -L 100M test
  Rounding size 100.00 MiB (25 extents) up to stripe boundary size 112.00 MiB (28 extents).
  Logical volume "lvol4" created.

[root@host-082 ~]# lvcreate --type raid0 -L 100M test
  Segment type 'raid0' requires 2 or more stripes.


Version-Release number of selected component (if applicable):
3.10.0-419.el7.x86_64

lvm2-2.02.160-1.el7    BUILT: Wed Jul  6 11:16:47 CDT 2016
lvm2-libs-2.02.160-1.el7    BUILT: Wed Jul  6 11:16:47 CDT 2016
lvm2-cluster-2.02.160-1.el7    BUILT: Wed Jul  6 11:16:47 CDT 2016
device-mapper-1.02.130-1.el7    BUILT: Wed Jul  6 11:16:47 CDT 2016
device-mapper-libs-1.02.130-1.el7    BUILT: Wed Jul  6 11:16:47 CDT 2016
device-mapper-event-1.02.130-1.el7    BUILT: Wed Jul  6 11:16:47 CDT 2016
device-mapper-event-libs-1.02.130-1.el7    BUILT: Wed Jul  6 11:16:47 CDT 2016
device-mapper-persistent-data-0.6.2-0.1.rc8.el7    BUILT: Wed May  4 02:56:34 CDT 2016
cmirror-2.02.160-1.el7    BUILT: Wed Jul  6 11:16:47 CDT 2016
sanlock-3.3.0-1.el7    BUILT: Wed Feb 24 09:52:30 CST 2016
sanlock-lib-3.3.0-1.el7    BUILT: Wed Feb 24 09:52:30 CST 2016
lvm2-lockd-2.02.160-1.el7    BUILT: Wed Jul  6 11:16:47 CDT 2016

Comment 2 Heinz Mauelshagen 2016-07-13 09:58:09 UTC
When creating raid4/5/6/10 LVs without requesting stripes or providing a PV list
on the command line, all PVs of the VG will be tried using for stripes. That'll either cause unexpected many stripes (e.g. 60 with 60 PVs in the VG) or fail in case the current lvm limit for maximum RAID stripes is surpassed

I propose new defaults for the various raid mappings, in particular to avoid that 'stripe bomb' occuring without -i/--stripes provided:

raid0: 2 stripes (i.e. 2 stripes net capacity)
raid4/5/6: 3 stripes total (i.e. 2 stripes net capacity)
raid6: 5 stripes (i.e. 3 stripes net capacity)
raid10: 4 stripes (capacity depends on raid10 data copies, e.g. 2 data copies = net 2 stripes capacity)

Comment 3 Heinz Mauelshagen 2016-07-13 17:22:42 UTC
As a future direction, we may add config options for the number of stripes so that those can be defined in lvm.conf and/or set/overridden with command line option --config.

Comment 4 Heinz Mauelshagen 2016-07-13 17:42:27 UTC
line "raid4/5/6: 3 stripes total (i.e. 2 stripes net capacity)" in comment #2

should read

"raid4/5: 3 stripes total (i.e. 2 stripes net capacity)"

Comment 5 Heinz Mauelshagen 2016-07-13 19:46:56 UTC
Upstream commit 3928c96a37941d765bf467d82502cd2aec7fd809
sets defaults as of comments #2/#4

Comment 6 Heinz Mauelshagen 2016-07-20 15:26:26 UTC
Upstream commit 7eb79091937d01eec51fc6a034879a6fe607231d makes the previous
behaviour of taking all devices to stripe across when none have been provided via -i/--stripes configurable via
"activation/raid_stripe_all_devices = [0/1]"
in lvm.conf(5).

That option defaults to '0', hence supplying new defaults as of comments #2/#4
but provides the user with requesting the old behaviour in case his deployments
rely on it.

Comment 8 Corey Marthaler 2016-09-28 22:31:30 UTC
Fix verified in the latest rpms.

3.10.0-510.el7.x86_64

lvm2-2.02.166-1.el7    BUILT: Wed Sep 28 02:26:52 CDT 2016
lvm2-libs-2.02.166-1.el7    BUILT: Wed Sep 28 02:26:52 CDT 2016
lvm2-cluster-2.02.166-1.el7    BUILT: Wed Sep 28 02:26:52 CDT 2016
device-mapper-1.02.135-1.el7    BUILT: Wed Sep 28 02:26:52 CDT 2016
device-mapper-libs-1.02.135-1.el7    BUILT: Wed Sep 28 02:26:52 CDT 2016
device-mapper-event-1.02.135-1.el7    BUILT: Wed Sep 28 02:26:52 CDT 2016
device-mapper-event-libs-1.02.135-1.el7    BUILT: Wed Sep 28 02:26:52 CDT 2016
device-mapper-persistent-data-0.6.3-1.el7    BUILT: Fri Jul 22 05:29:13 CDT 2016



[root@host-116 ~]# lvcreate --type raid0 -L 100M vg
  Using default stripesize 64.00 KiB.
  Rounding size 100.00 MiB (25 extents) up to stripe boundary size 104.00 MiB (26 extents).
  Logical volume "lvol0" created.

[root@host-116 ~]# lvcreate --type raid0_meta -L 100M vg
  Using default stripesize 64.00 KiB.
  Rounding size 100.00 MiB (25 extents) up to stripe boundary size 104.00 MiB (26 extents).
  Logical volume "lvol1" created.

  lvol0            vg rwi-a-r--- 104.00m   lvol0_rimage_0(0),lvol0_rimage_1(0)               
  [lvol0_rimage_0] vg iwi-aor---  52.00m   /dev/sda1(0)                                      
  [lvol0_rimage_1] vg iwi-aor---  52.00m   /dev/sdb1(0)                                      

  lvol1            vg rwi-a-r--- 104.00m   lvol1_rimage_0(0),lvol1_rimage_1(0)               
  [lvol1_rimage_0] vg iwi-aor---  52.00m   /dev/sda1(14)                                     
  [lvol1_rimage_1] vg iwi-aor---  52.00m   /dev/sdb1(14)                                     
  [lvol1_rmeta_0]  vg ewi-aor---   4.00m   /dev/sda1(13)                                     
  [lvol1_rmeta_1]  vg ewi-aor---   4.00m   /dev/sdb1(13)

Comment 10 errata-xmlrpc 2016-11-04 04:15:36 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.

https://rhn.redhat.com/errata/RHBA-2016-1445.html


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