Bug 1872130
Summary: | error code for up conversion of degraded raid should reflect actual cmd result | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 8 | Reporter: | Roman Bednář <rbednar> |
Component: | lvm2 | Assignee: | David Teigland <teigland> |
lvm2 sub component: | Mirroring and RAID | QA Contact: | cluster-qe <cluster-qe> |
Status: | CLOSED ERRATA | Docs Contact: | |
Severity: | medium | ||
Priority: | urgent | CC: | agk, cmarthal, heinzm, jbrassow, mcsontos, msnitzer, prajnoha, rhandlin, zkabelac |
Version: | 8.3 | Keywords: | Regression |
Target Milestone: | rc | ||
Target Release: | 8.0 | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | lvm2-2.03.11-0.2.20201103git8801a86.el8 | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2021-05-18 15:01:53 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: | |
Embargoed: |
Description
Roman Bednář
2020-08-25 07:16:57 UTC
Like Roman's commands above showed, the up conversion still doesn't actually work (like expected), but the error code now appears to have regressed in that it now reports that these attempts actually worked. [root@hayes-01 ~]# lvs -a -o +devices LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert Devices degraded_upconvert raid_sanity rwi-a-r-r- 100.00m 100.00 degraded_upconvert_rimage_0(0),degraded_upconvert_rimage_1(0) [degraded_upconvert_rimage_0] raid_sanity vwi-aor-r- 100.00m [degraded_upconvert_rimage_1] raid_sanity iwi-aor--- 100.00m /dev/sdj1(1) [degraded_upconvert_rmeta_0] raid_sanity ewi-aor-r- 4.00m [degraded_upconvert_rmeta_1] raid_sanity ewi-aor--- 4.00m /dev/sdj1(0) # Try to up convert to 2 legs (-m 1) [root@hayes-01 ~]# lvconvert --yes -m 1 raid_sanity/degraded_upconvert /dev/sdb1 Type raid1 LV raid_sanity/degraded_upconvert already has 2 images. Logical volume raid_sanity/degraded_upconvert successfully converted. [root@hayes-01 ~]# echo $? 0 # Try to up convert to 3 legs (-m 2) [root@hayes-01 ~]# lvconvert --yes -m 2 raid_sanity/degraded_upconvert /dev/sdb1 Can't change number of mirrors of degraded raid_sanity/degraded_upconvert. Please run "lvconvert --repair raid_sanity/degraded_upconvert" first. Logical volume raid_sanity/degraded_upconvert successfully converted. [root@hayes-01 ~]# echo $? 0 I downgraded to the prior lvm version to show a contrast of error codes: lvm2-2.03.09-3.el8 BUILT: Mon Jun 29 13:50:23 CDT 2020 lvm2-dbusd-2.03.09-5.el8 BUILT: Wed Aug 12 15:49:44 CDT 2020 lvm2-lockd-2.03.09-3.el8 BUILT: Mon Jun 29 13:50:23 CDT 2020 [root@hayes-01 ~]# lvs -a -o +devices LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert Devices degraded_upconvert raid_sanity rwi-a-r-r- 100.00m 100.00 degraded_upconvert_rimage_0(0),degraded_upconvert_rimage_1(0) [degraded_upconvert_rimage_0] raid_sanity iwi-aor--- 100.00m /dev/sdb1(1) [degraded_upconvert_rimage_1] raid_sanity vwi-aor-r- 100.00m [degraded_upconvert_rmeta_0] raid_sanity ewi-aor--- 4.00m /dev/sdb1(0) [degraded_upconvert_rmeta_1] raid_sanity ewi-aor-r- 4.00m # Expected behavior and error code [root@hayes-01 ~]# lvconvert --yes -m 1 raid_sanity/degraded_upconvert /dev/sdj1 Can't change number of mirrors of degraded raid_sanity/degraded_upconvert. Please run "lvconvert --repair raid_sanity/degraded_upconvert" first. WARNING: raid_sanity/degraded_upconvert already has image count of 2. [root@hayes-01 ~]# echo $? 5 # This one was a surprise, as it appears to be the exact same as latest rpms, and even though it gives a error "Can't change number of mirrors of degraded", this command actually *does* work w/o having to do the --repair cmd first. [root@hayes-01 ~]# lvconvert --yes -m 2 raid_sanity/degraded_upconvert /dev/sdj1 Can't change number of mirrors of degraded raid_sanity/degraded_upconvert. Please run "lvconvert --repair raid_sanity/degraded_upconvert" first. Logical volume raid_sanity/degraded_upconvert successfully converted. [root@hayes-01 ~]# echo $? 0 [root@hayes-01 ~]# lvs -a -o +devices LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert Devices degraded_upconvert raid_sanity rwi-a-r-r- 100.00m 100.00 degraded_upconvert_rimage_0(0),degraded_upconvert_rimage_1(0),degraded_upconvert_rimage_2(0) [degraded_upconvert_rimage_0] raid_sanity iwi-aor--- 100.00m /dev/sdb1(1) [degraded_upconvert_rimage_1] raid_sanity vwi-aor-r- 100.00m [degraded_upconvert_rimage_2] raid_sanity iwi-aor--- 100.00m /dev/sdj1(1) [degraded_upconvert_rmeta_0] raid_sanity ewi-aor--- 4.00m /dev/sdb1(0) [degraded_upconvert_rmeta_1] raid_sanity ewi-aor-r- 4.00m [degraded_upconvert_rmeta_2] raid_sanity ewi-aor--- 4.00m /dev/sdj1(0) It looks like this bug is caused by this commit: commit 3c9177fdc0b8f94c0ae335790a485477901b685d Author: Heinz Mauelshagen <heinzm> Date: Mon Jul 20 15:36:25 2020 +0200 lvconvert: display warning if raid1 LV image count does not change Fix "lvconvert -mN $RaidLV" to display a warning in case the same number of images is being requested. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1774696 If I revert that commit and repeat the test described above, I believe that we get the desired behavior: # lvs -a test -o+devices,segtype LV VG Attr LSize Cpy%Sync Devices Type mm test rwi-a-r-r- 100.00m 100.00 mm_rimage_0(0),mm_rimage_1(0) raid1 [mm_rimage_0] test iwi-aor--- 100.00m /dev/sdb(1) linear [mm_rimage_1] test vwi-aor-r- 100.00m error [mm_rmeta_0] test ewi-aor--- 4.00m /dev/sdb(0) linear [mm_rmeta_1] test ewi-aor-r- 4.00m error # lvconvert -y -m1 test/mm /dev/sdc Can't change number of mirrors of degraded test/mm. Please run "lvconvert --repair test/mm" first. WARNING: test/mm already has image count of 2. # echo $? 5 I hesitate to revert commit 3c9177fd because it claims to be fixing bug 1774696. However, looking at 1774696, I'm not sure if the commit above is actually necessary. bug 1774696 requests a change for "mirror", but commit 3c9177fd changes "raid1". Heinz, can you confirm if we can safely revert commit 3c9177fd to fix this bz, without breaking bz 1774696? (In reply to David Teigland from comment #4) > It looks like this bug is caused by this commit: > > commit 3c9177fdc0b8f94c0ae335790a485477901b685d > Author: Heinz Mauelshagen <heinzm> > Date: Mon Jul 20 15:36:25 2020 +0200 > > lvconvert: display warning if raid1 LV image count does not change > > Fix "lvconvert -mN $RaidLV" to display a warning in > case the same number of images is being requested. > > Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1774696 > > > If I revert that commit and repeat the test described above, I believe that > we get the desired behavior: > > # lvs -a test -o+devices,segtype > LV VG Attr LSize Cpy%Sync Devices > Type > mm test rwi-a-r-r- 100.00m 100.00 > mm_rimage_0(0),mm_rimage_1(0) raid1 > [mm_rimage_0] test iwi-aor--- 100.00m /dev/sdb(1) > linear > [mm_rimage_1] test vwi-aor-r- 100.00m > error > [mm_rmeta_0] test ewi-aor--- 4.00m /dev/sdb(0) > linear > [mm_rmeta_1] test ewi-aor-r- 4.00m > error > > # lvconvert -y -m1 test/mm /dev/sdc > Can't change number of mirrors of degraded test/mm. > Please run "lvconvert --repair test/mm" first. > WARNING: test/mm already has image count of 2. > > # echo $? > 5 > > > I hesitate to revert commit 3c9177fd because it claims to be fixing bug > 1774696. However, looking at 1774696, I'm not sure if the commit above is > actually necessary. bug 1774696 requests a change for "mirror", but commit > 3c9177fd changes "raid1". > > Heinz, can you confirm if we can safely revert commit 3c9177fd to fix this > bz, without breaking bz 1774696? Yes, 3c9177fd can be reverted safely, a check for the same image count is in lv_raid_change_image_count() already. Reverted in master: 8952dcbff0c1ca9bfaa2f8fe8b6da78a10319e6b stable-2.02: 7e2ceba2fb6ea6769608858f7ce9a88e5ff3eb68 I'll revisit bug 1774696 relative to 'mirror'. 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 (lvm2 bug fix and enhancement update), 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://access.redhat.com/errata/RHBA-2021:1659 |