Bug 877811
| Summary: | lvconvert --repair ignores -f option when -y option is used | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 6 | Reporter: | benscott |
| Component: | lvm2 | Assignee: | Peter Rajnoha <prajnoha> |
| Status: | CLOSED ERRATA | QA Contact: | Cluster QE <mspqa-list> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 6.5 | CC: | agk, dwysocha, heinzm, jbrassow, msnitzer, nperic, prajnoha, prockai, thornber, tlavigne, zkabelac |
| Target Milestone: | rc | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | lvm2-2.02.98-5.el6 | Doc Type: | Bug Fix |
| Doc Text: |
The lvconvert command handles the -y and -f command line options inconsistently when repairing mirror or raid volumes. With the -f option alone, the broken image is removed but in conjunction with the -y option, the -f option is ignored and replacement is done.
The tool now handles -f correctly and doesn't replace volumes, as described on the man page.
|
Story Points: | --- |
| Clone Of: | Environment: | ||
| Last Closed: | 2013-02-21 08:15:01 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: | |||
| Bug Depends On: | |||
| Bug Blocks: | 888457 | ||
Patch is upstream now: http://git.fedorahosted.org/cgit/lvm2.git/commit/?id=f942ae4a7af0f9b93c6a6aacb1793ee22f87ed13 Adding QA Ack with test being described in the BZ report/description, and a self-reminder that this should be tested with --type mirror and --type raid1 as well. Standard mirrors: ================= (test with lvconvert --repair -y) $ lvcreate -l1 -m1 vg Logical volume "lvol0" created $ lvs -a -o lv_name,devices LV Devices root /dev/vda1(0) swap /dev/vda1(2250) lvol0 lvol0_mimage_0(0),lvol0_mimage_1(0) [lvol0_mimage_0] /dev/sda(0) [lvol0_mimage_1] /dev/sdb(0) [lvol0_mlog] /dev/sdc(0) $ echo offline > /sys/block/sda/device/state $ lvs -a -o lv_name,devices Couldn't find device with uuid gHAo1c-YSOh-iFHM-9p0k-EfhX-gk8C-asEvLE. LV Devices root /dev/vda1(0) swap /dev/vda1(2250) lvol0 lvol0_mimage_0(0),lvol0_mimage_1(0) [lvol0_mimage_0] unknown device(0) [lvol0_mimage_1] /dev/sdb(0) [lvol0_mlog] /dev/sdc(0) $ lvconvert --repair -y vg/lvol0 Couldn't find device with uuid gHAo1c-YSOh-iFHM-9p0k-EfhX-gk8C-asEvLE. Mirror status: 1 of 2 images failed. Trying to up-convert to 2 images, 1 logs. vg/lvol0: Converted: 100.0% $ lvs -a -o lv_name,devices Couldn't find device with uuid gHAo1c-YSOh-iFHM-9p0k-EfhX-gk8C-asEvLE. LV Devices root /dev/vda1(0) swap /dev/vda1(2250) lvol0 lvol0_mimage_0(0),lvol0_mimage_1(0) [lvol0_mimage_0] /dev/sdb(0) [lvol0_mimage_1] /dev/sdc(0) [lvol0_mlog] /dev/sdc(1) --- (test with lvconvert --repair -y -f) $ lvcreate -l1 -m1 vg Logical volume "lvol0" created $ lvs -a -o lv_name,devices LV Devices root /dev/vda1(0) swap /dev/vda1(2250) lvol0 lvol0_mimage_0(0),lvol0_mimage_1(0) [lvol0_mimage_0] /dev/sda(0) [lvol0_mimage_1] /dev/sdb(0) [lvol0_mlog] /dev/sdc(0) $ echo offline > /sys/block/sda/device/state $ lvs -a -o lv_name,devices Couldn't find device with uuid gHAo1c-YSOh-iFHM-9p0k-EfhX-gk8C-asEvLE. LV Devices root /dev/vda1(0) swap /dev/vda1(2250) lvol0 lvol0_mimage_0(0),lvol0_mimage_1(0) [lvol0_mimage_0] unknown device(0) [lvol0_mimage_1] /dev/sdb(0) [lvol0_mlog] /dev/sdc(0) $ lvconvert --repair -y -f vg/lvol0 Couldn't find device with uuid gHAo1c-YSOh-iFHM-9p0k-EfhX-gk8C-asEvLE. Mirror status: 1 of 2 images failed. $ lvs -a -o lv_name,devices Couldn't find device with uuid gHAo1c-YSOh-iFHM-9p0k-EfhX-gk8C-asEvLE. LV Devices root /dev/vda1(0) swap /dev/vda1(2250) lvol0 /dev/sdb(0) RAID mirrors ============ (test with lvconvert --repair -y) $ lvcreate -l1 -m1 --type raid1 vg Logical volume "lvol0" created $ lvs -a -o lv_name,devices LV Devices root /dev/vda1(0) swap /dev/vda1(2250) lvol0 lvol0_rimage_0(0),lvol0_rimage_1(0) [lvol0_rimage_0] /dev/sda(1) [lvol0_rimage_1] /dev/sdb(1) [lvol0_rmeta_0] /dev/sda(0) [lvol0_rmeta_1] /dev/sdb(0) $ echo offline > /sys/block/sda/device/state $ lvs -a -o lv_name,devices Couldn't find device with uuid gHAo1c-YSOh-iFHM-9p0k-EfhX-gk8C-asEvLE. LV Devices root /dev/vda1(0) swap /dev/vda1(2250) lvol0 lvol0_rimage_0(0),lvol0_rimage_1(0) [lvol0_rimage_0] unknown device(1) [lvol0_rimage_1] /dev/sdb(1) [lvol0_rmeta_0] unknown device(0) [lvol0_rmeta_1] /dev/sdb(0) $ lvconvert --repair -y vg/lvol0 Couldn't find device with uuid gHAo1c-YSOh-iFHM-9p0k-EfhX-gk8C-asEvLE. Faulty devices in vg/lvol0 successfully replaced. $ lvs -a -o lv_name,devices Couldn't find device with uuid gHAo1c-YSOh-iFHM-9p0k-EfhX-gk8C-asEvLE. LV Devices root /dev/vda1(0) swap /dev/vda1(2250) lvol0 lvol0_rimage_0(0),lvol0_rimage_1(0) [lvol0_rimage_0] /dev/sdc(1) [lvol0_rimage_1] /dev/sdb(1) [lvol0_rmeta_0] /dev/sdc(0) [lvol0_rmeta_1] /dev/sdb(0) --- (test with lvconvert --repair -y -f) $ lvcreate -l1 -m1 --type raid1 vg Logical volume "lvol0" created $ lvs -a -o lv_name,devices LV Devices root /dev/vda1(0) swap /dev/vda1(2250) lvol0 lvol0_rimage_0(0),lvol0_rimage_1(0) [lvol0_rimage_0] /dev/sda(1) [lvol0_rimage_1] /dev/sdb(1) [lvol0_rmeta_0] /dev/sda(0) [lvol0_rmeta_1] /dev/sdb(0) $ echo offline > /sys/block/sda/device/state $ lvs -a -o lv_name,devices Couldn't find device with uuid gHAo1c-YSOh-iFHM-9p0k-EfhX-gk8C-asEvLE. LV Devices root /dev/vda1(0) swap /dev/vda1(2250) lvol0 lvol0_rimage_0(0),lvol0_rimage_1(0) [lvol0_rimage_0] unknown device(1) [lvol0_rimage_1] /dev/sdb(1) [lvol0_rmeta_0] unknown device(0) [lvol0_rmeta_1] /dev/sdb(0) $ lvconvert --repair -y -f vg/lvol0 Couldn't find device with uuid gHAo1c-YSOh-iFHM-9p0k-EfhX-gk8C-asEvLE. $ lvs -a -o lv_name,devices Couldn't find device with uuid gHAo1c-YSOh-iFHM-9p0k-EfhX-gk8C-asEvLE. LV Devices root /dev/vda1(0) swap /dev/vda1(2250) lvol0 lvol0_rimage_0(0),lvol0_rimage_1(0) [lvol0_rimage_0] unknown device(1) [lvol0_rimage_1] /dev/sdb(1) [lvol0_rmeta_0] unknown device(0) [lvol0_rmeta_1] /dev/sdb(0) Tested with type mirror and raid (mirror in clustered mode as well, raid not supported). Marking the behaviour the same as described in Comment #4. tested with: lvm2-2.02.98-5.el6.x86_64 lvm2-cluster-2.02.98-5.el6.x86_64 device-mapper-1.02.77-5.el6.x86_64 cmirror-2.02.98-5.el6.x86_64 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-0501.html |
Description of problem: The lvconvert command seems inconsistent in applying the command line options -y and -f on mirror repairs. If I specify the -f option alone the broken image is removed as implied by the man page but in conjuntion with the -y option, the -f option is ignored and replacement is done. in other words: lvconvert --repair -f name <<removes the faulty image>> lvconvert --repair -y -f name <<replaces the faulty image>> From the lvconvert man page: --repair Repair a mirror after suffering a disk failure. The mirror will be brought back into a consistent state. By default, the original number of mirrors will be restored if possible. Specify -y on the command line to skip the prompts. Use -f if you do not want any replacement. Additionally, you may use --use-policies to use the device replacement policy specified in lvm.conf(5), viz. activation/mirror_log_fault_policy or activation/mirror_device_fault_policy. { TEST SETUP FOLLOWS } #lvs --version LVM version: 2.02.98(2) (2012-10-15) Library version: 1.02.77 (2012-10-15) Driver version: 4.23.0 The test mirror with all physical devices working: ~# pvs PV VG Fmt Attr PSize PFree /dev/sdc vg1 lvm2 a-- 5.13g 4.93g /dev/sdd vg1 lvm2 a-- 5.13g 5.12g /dev/sde vg1 lvm2 a-- 5.13g 4.93g /dev/sdf vg1 lvm2 a-- 5.13g 5.13g ~# lvs --all -o +devices LV VG Attr LSize Log Copy% Devices lvol0 vg1 mwi-a-m-- 200.00m lvol0_mlog 100.00 lvol0_mimage_0(0),lvol0_mimage_1(0) [lvol0_mimage_0] vg1 iwi-aom-- 200.00m /dev/sdc(0) [lvol0_mimage_1] vg1 iwi-aom-- 200.00m /dev/sde(0) [lvol0_mlog] vg1 lwi-aom-- 2.00m /dev/sdd(0) Now we kill off device /dev/sdc: ~# lvs --all -o +devices Couldn't find device with uuid AnR728-QcVB-R47B-qU2y-Ns0S-H1Mh-premLH. LV VG Attr LSize Log Copy% Devices lvol0 vg1 mwi-a-m-p 200.00m lvol0_mlog 100.00 lvol0_mimage_0(0),lvol0_mimage_1(0) [lvol0_mimage_0] vg1 iwi-aom-p 200.00m unknown device(0) [lvol0_mimage_1] vg1 iwi-aom-- 200.00m /dev/sde(0) [lvol0_mlog] vg1 lwi-aom-- 2.00m /dev/sdd(0) { END TEST SETUP } { TEST ONE } Run lvconvert with the -y and -f option: ~# lvconvert --repair -y -f vg1/lvol0 Couldn't find device with uuid AnR728-QcVB-R47B-qU2y-Ns0S-H1Mh-premLH. Mirror status: 1 of 2 images failed. Trying to up-convert to 2 images, 1 logs. vg1/lvol0: Converted: 2.0% vg1/lvol0: Converted: 100.0% ~# lvs --all -o +devices Couldn't find device with uuid AnR728-QcVB-R47B-qU2y-Ns0S-H1Mh-premLH. LV VG Attr LSize Log Copy% Devices lvol0 vg1 mwi-a-m-- 200.00m lvol0_mlog 100.00 lvol0_mimage_0(0),lvol0_mimage_1(0) [lvol0_mimage_0] vg1 iwi-aom-- 200.00m /dev/sde(0) [lvol0_mimage_1] vg1 iwi-aom-- 200.00m /dev/sdf(0) [lvol0_mlog] vg1 lwi-aom-- 2.00m /dev/sdd(1) { END TEST ONE } { TEST TWO } If I Recreate the original mirror and then break it the same way and run lvconvert with only the -f option: ~# lvconvert --repair -f vg1/lvol0 Couldn't find device with uuid AnR728-QcVB-R47B-qU2y-Ns0S-H1Mh-premLH. Mirror status: 1 of 2 images failed. ~# lvs --all -o +devices Couldn't find device with uuid AnR728-QcVB-R47B-qU2y-Ns0S-H1Mh-premLH. LV VG Attr LSize Log Copy% Convert Devices lvol0 vg1 -wi-a---- 200.00m /dev/sde(0) { END TEST TWO } So if I use the -y option lvconvert ignores the -f option and replaces the missing physical volumes while it works as expected without the -y option.