| Summary: | striped raid extension into contiguous space is broken | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 6 | Reporter: | Corey Marthaler <cmarthal> |
| Component: | lvm2 | Assignee: | Jonathan Earl Brassow <jbrassow> |
| Status: | CLOSED ERRATA | QA Contact: | Cluster QE <mspqa-list> |
| Severity: | high | Docs Contact: | |
| Priority: | high | ||
| Version: | 6.5 | CC: | agk, cmarthal, dwysocha, heinzm, jbrassow, msnitzer, prajnoha, prockai, thornber, zkabelac |
| Target Milestone: | rc | Keywords: | Regression, TestBlocker |
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | lvm2-2.02.100-4.el6 | Doc Type: | Bug Fix |
| Doc Text: |
Intra-release bug caused this - no doc text required.
|
Story Points: | --- |
| Clone Of: | Environment: | ||
| Last Closed: | 2013-11-21 23:27:41 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
|
Description
Corey Marthaler
2013-09-06 22:49:45 UTC
FWIW, the mirrored raids (raid1,10) still do the right thing. 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 (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. 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) 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) 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.
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 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 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 |