Bug 2035238 - [RFE] $lvconvert -m 0 should print warnings while unmirror the device from the mirroring and it should remove the device which mention in the lvconvert command only not the all device or any other devices
Summary: [RFE] $lvconvert -m 0 should print warnings while unmirror the device from t...
Keywords:
Status: NEW
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: lvm2
Version: 8.0
Hardware: All
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: Heinz Mauelshagen
QA Contact: cluster-qe
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-12-23 10:53 UTC by pratapsingh
Modified: 2023-08-10 15:41 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-106505 0 None None None 2021-12-23 10:58:53 UTC

Description pratapsingh 2021-12-23 10:53:11 UTC
Description of problem:

$lvconvert -m 0 command should print warnings while unmirror the device from the mirroring  and it should only remove the device which mention in the lvconvert command not the all device or any other devices.

Version-Release number of selected component (if applicable):

RHEL ALL

How reproducible:


Steps to Reproduce:


1. I mirrored sdf and sdc and the original was on sdd and sdb

I ran the command to remove FROM sdb and sdf (instead of sdd) and it removed it from sdf and sdc, the new mirror.


[root@rhel8-3 ~]# pvs
  PV         VG    Fmt  Attr PSize   PFree  
  /dev/sdb   vgapp lvm2 a--  100.00m      0 
  /dev/sdc   vgapp lvm2 a--  100.00m 100.00m
  /dev/sdd   vgapp lvm2 a--  100.00m      0 
  /dev/sdf   vgapp lvm2 a--  100.00m 100.00m

[root@rhel8-3 ~]# lvs --all --segments -o lv_name,vg_name,stripes,segtype,seg_size,copy_percent,devices  vgapp
  LV            VG    #Str Type   SSize   Cpy%Sync Devices    
  lvapplication vgapp    1 linear 100.00m          /dev/sdb(0)
  lvapplication vgapp    1 linear 100.00m          /dev/sdd(0)

--> Added /dev/sdf & /dev/sdc

[root@rhel8-3 ~]# lvconvert -m 1 --type mirror --mirrorlog core /dev/vgapp/lvapplication /dev/sdf /dev/sdc
  Logical volume vgapp/lvapplication being converted.
  vgapp/lvapplication: Converted: 8.00%
  vgapp/lvapplication: Converted: 100.00%

[root@rhel8-3 ~]# lvs --all --segments -o lv_name,vg_name,stripes,segtype,seg_size,copy_percent,devices  vgapp
  LV                       VG    #Str Type   SSize   Cpy%Sync Devices                                            
  lvapplication            vgapp    2 mirror 200.00m 100.00   lvapplication_mimage_0(0),lvapplication_mimage_1(0)
  [lvapplication_mimage_0] vgapp    1 linear 100.00m          /dev/sdb(0)                                        
  [lvapplication_mimage_0] vgapp    1 linear 100.00m          /dev/sdd(0)                                        
  [lvapplication_mimage_1] vgapp    1 linear 100.00m          /dev/sdf(0)                                        
  [lvapplication_mimage_1] vgapp    1 linear 100.00m          /dev/sdc(0)  

--> I ran the command to remove from the /dev/sdb and /dev/sdf 

[root@rhel8-3 ~]#  lvconvert -m 0 /dev/vgapp/lvapplication /dev/sdb /dev/sdf
  Logical volume vgapp/lvapplication converted.


-->But it removed it from sdf and sdc, the new mirror instead of /dev/sdb.

  [root@rhel8-3 ~]# lvs --all --segments -o lv_name,vg_name,stripes,segtype,seg_size,copy_percent,devices  vgapp
  LV            VG    #Str Type   SSize   Cpy%Sync Devices    
  lvapplication vgapp    1 linear 100.00m          /dev/sdb(0)
  lvapplication vgapp    1 linear 100.00m          /dev/sdd(0)
[root@rhel8-3 ~]# 

2. Second example 

I mirrored to sdf and sdc again and then unmirrored from just one of the old disks, sdb, and it removed the mirror from sdf and sdc again.

[root@rhel8-3 ~]# lvconvert -m 1 --type mirror --mirrorlog core /dev/vgapp/lvapplication /dev/sdf /dev/sdc
  Logical volume vgapp/lvapplication being converted.
  vgapp/lvapplication: Converted: 8.00%
  vgapp/lvapplication: Converted: 100.00%

[root@rhel8-3 ~]# lvs --all --segments -o lv_name,vg_name,stripes,segtype,seg_size,copy_percent,devices  vgapp
  LV                       VG    #Str Type   SSize   Cpy%Sync Devices                                            
  lvapplication            vgapp    2 mirror 200.00m 100.00   lvapplication_mimage_0(0),lvapplication_mimage_1(0)
  [lvapplication_mimage_0] vgapp    1 linear 100.00m          /dev/sdb(0)                                        
  [lvapplication_mimage_0] vgapp    1 linear 100.00m          /dev/sdd(0)                                        
  [lvapplication_mimage_1] vgapp    1 linear 100.00m          /dev/sdf(0)                                        
  [lvapplication_mimage_1] vgapp    1 linear 100.00m          /dev/sdc(0)                                        

[root@rhel8-3 ~]# lvconvert -m 0 /dev/vgapp/lvapplication /dev/sdb
  Logical volume vgapp/lvapplication converted.

[root@rhel8-3 ~]# lvs --all --segments -o lv_name,vg_name,stripes,segtype,seg_size,copy_percent,devices  vgapp
  LV            VG    #Str Type   SSize   Cpy%Sync Devices    
  lvapplication vgapp    1 linear 100.00m          /dev/sdb(0) -----------> the device which I mentioned that device still lvm showing. 
  lvapplication vgapp    1 linear 100.00m          /dev/sdd(0)
~~~~


Actual results:

$lvconvert command unmirror newly added mirror device
$lvconvert unmirror the device which accidentally mentioned while removing the device without warning. 


Expected results:

$lvconvert command should print warning prior to unmirror device.
$lvconvert should remove the device that's only mentioned in the command not the other device.


Additional info:


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