Bug 1656109 - potential for mirror image redundancy loss when converting from core -> disk log uses existing mimage device
Summary: potential for mirror image redundancy loss when converting from core -> disk ...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: lvm2
Version: 8.0
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: rc
: 8.0
Assignee: Heinz Mauelshagen
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-12-04 17:20 UTC by Corey Marthaler
Modified: 2019-08-01 14:38 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-08-01 14:38:18 UTC
Type: Bug
Target Upstream Version:


Attachments (Terms of Use)

Description Corey Marthaler 2018-12-04 17:20:03 UTC
Description of problem:

[root@hayes-01 bin]# lvcreate  --type mirror -m 1 -n mirror_log_convert --mirrorlog core -L 2T mirror_sanity /dev/sdk1 /dev/sdb1 /dev/sdc1 /dev/sdd1
  Logical volume "mirror_log_convert" created.
[root@hayes-01 bin]# lvs -a -o +devices
  LV                            VG            Attr       LSize Log Cpy%Sync Devices
  mirror_log_convert            mirror_sanity mwi-a-m--- 2.00t     0.02     mirror_log_convert_mimage_0(0),mirror_log_convert_mimage_1(0)
  [mirror_log_convert_mimage_0] mirror_sanity Iwi-aom--- 2.00t              /dev/sdb1(0)
  [mirror_log_convert_mimage_0] mirror_sanity Iwi-aom--- 2.00t              /dev/sdk1(0)
  [mirror_log_convert_mimage_1] mirror_sanity Iwi-aom--- 2.00t              /dev/sdc1(0)
  [mirror_log_convert_mimage_1] mirror_sanity Iwi-aom--- 2.00t              /dev/sdd1(0)

[root@hayes-01 bin]# lvconvert --type mirror -m 1 --mirrorlog disk /dev/mirror_sanity/mirror_log_convert
  Logical volume mirror_sanity/mirror_log_convert converted.
[root@hayes-01 bin]# lvs -a -o +devices
  LV                            VG            Attr       LSize Log                       Cpy%Sync Devices
  mirror_log_convert            mirror_sanity mwi-a-m--- 2.00t [mirror_log_convert_mlog] 0.01     mirror_log_convert_mimage_0(0),mirror_log_convert_mimage_1(0)
  [mirror_log_convert_mimage_0] mirror_sanity Iwi-aom--- 2.00t                                    /dev/sdb1(0)
  [mirror_log_convert_mimage_0] mirror_sanity Iwi-aom--- 2.00t                                    /dev/sdk1(0)
  [mirror_log_convert_mimage_1] mirror_sanity Iwi-aom--- 2.00t                                    /dev/sdc1(0)
  [mirror_log_convert_mimage_1] mirror_sanity Iwi-aom--- 2.00t                                    /dev/sdd1(0)
  [mirror_log_convert_mlog]     mirror_sanity lwi-aom--- 4.00m                                    /dev/sdk1(47489)  <- this should not be on an existing mimage device 

# There's plenty of free space
[root@hayes-01 bin]# pvscan
  PV /dev/sdb1   VG mirror_sanity   lvm2 [<1.82 TiB / 0    free]
  PV /dev/sdc1   VG mirror_sanity   lvm2 [<1.82 TiB / 0    free]
  PV /dev/sdd1   VG mirror_sanity   lvm2 [<1.82 TiB / <1.64 TiB free]
  PV /dev/sde1   VG mirror_sanity   lvm2 [<1.82 TiB / <1.82 TiB free]
  PV /dev/sdf1   VG mirror_sanity   lvm2 [<1.82 TiB / <1.82 TiB free]
  PV /dev/sdg1   VG mirror_sanity   lvm2 [<1.82 TiB / <1.82 TiB free]
  PV /dev/sdh1   VG mirror_sanity   lvm2 [<1.82 TiB / <1.82 TiB free]
  PV /dev/sdi1   VG mirror_sanity   lvm2 [<1.82 TiB / <1.82 TiB free]
  PV /dev/sdj1   VG mirror_sanity   lvm2 [<1.82 TiB / <1.82 TiB free]
  PV /dev/sdk1   VG mirror_sanity   lvm2 [<1.82 TiB / <1.64 TiB free]
  Total: 10 [<18.19 TiB] / in use: 10 [<18.19 TiB] / in no VG: 0 [0   ]


Version-Release number of selected component (if applicable):
kernel-4.18.0-39.el8    BUILT: Wed Nov 14 06:18:11 CST 2018
lvm2-2.03.01-1.el8    BUILT: Thu Nov  1 04:29:08 CDT 2018
lvm2-libs-2.03.01-1.el8    BUILT: Thu Nov  1 04:29:08 CDT 2018
lvm2-dbusd-2.03.01-1.el8    BUILT: Thu Nov  1 04:31:09 CDT 2018
lvm2-lockd-2.03.01-1.el8    BUILT: Thu Nov  1 04:29:08 CDT 2018
device-mapper-1.02.153-1.el8    BUILT: Thu Nov  1 04:29:08 CDT 2018
device-mapper-libs-1.02.153-1.el8    BUILT: Thu Nov  1 04:29:08 CDT 2018
device-mapper-event-1.02.153-1.el8    BUILT: Thu Nov  1 04:29:08 CDT 2018
device-mapper-event-libs-1.02.153-1.el8    BUILT: Thu Nov  1 04:29:08 CDT 2018
device-mapper-persistent-data-0.7.6-1.el8    BUILT: Sun Aug 12 04:21:55 CDT 2018


How reproducible:
Often

Comment 1 Corey Marthaler 2018-12-17 15:57:19 UTC
Another loss in redundancy regression scenario:

[root@hayes-02 ~]# pvscan
  PV /dev/sdk1   VG mirror_sanity   lvm2 [1020.00 MiB / 1020.00 MiB free]
  PV /dev/sdn1   VG mirror_sanity   lvm2 [1020.00 MiB / 1020.00 MiB free]
  PV /dev/sdl1   VG mirror_sanity   lvm2 [1020.00 MiB / 1020.00 MiB free]
  PV /dev/sdo1   VG mirror_sanity   lvm2 [1020.00 MiB / 1020.00 MiB free]
  PV /dev/sdd1   VG mirror_sanity   lvm2 [1020.00 MiB / 1020.00 MiB free]
  PV /dev/sdp1   VG mirror_sanity   lvm2 [1020.00 MiB / 1020.00 MiB free]
  PV /dev/sdh1   VG mirror_sanity   lvm2 [1020.00 MiB / 1020.00 MiB free]
  PV /dev/sdm1   VG mirror_sanity   lvm2 [1020.00 MiB / 1020.00 MiB free]
  PV /dev/sdc1   VG mirror_sanity   lvm2 [1020.00 MiB / 1020.00 MiB free]
  PV /dev/sdi1   VG mirror_sanity   lvm2 [1020.00 MiB / 1020.00 MiB free]
  Total: 10 [9.96 GiB] / in use: 10 [9.96 GiB] / in no VG: 0 [0   ]

# create spacer linears on /dev/sdk1 and /dev/sdn1
[root@hayes-02 ~]# lvcreate -L 400m mirror_sanity /dev/sdk1
  Logical volume "lvol0" created.
[root@hayes-02 ~]# lvcreate -L 400m mirror_sanity /dev/sdn1
  Logical volume "lvol1" created.

# create linear spanning both /dev/sdk1 and /dev/sdn1
[root@hayes-02 ~]# lvcreate -n span -L 400m mirror_sanity /dev/sdk1:0-150 /dev/sdn1:0-150
  Logical volume "span" created.
[root@hayes-02 ~]# lvs -a -o +devices
  LV    VG            Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert Devices       
  lvol0 mirror_sanity -wi-a----- 400.00m                                                     /dev/sdk1(0)  
  lvol1 mirror_sanity -wi-a----- 400.00m                                                     /dev/sdn1(0)  
  span  mirror_sanity -wi-a----- 400.00m                                                     /dev/sdk1(100)
  span  mirror_sanity -wi-a----- 400.00m                                                     /dev/sdn1(100)

# remove spacer linears on /dev/sdk1 and /dev/sdn1
[root@hayes-02 ~]# lvremove -f mirror_sanity/lvol0
  Logical volume "lvol0" successfully removed
[root@hayes-02 ~]# lvremove -f mirror_sanity/lvol1
  Logical volume "lvol1" successfully removed
[root@hayes-02 ~]# lvs -a -o +devices
  LV   VG            Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert Devices       
  span mirror_sanity -wi-a----- 400.00m                                                     /dev/sdk1(100)
  span mirror_sanity -wi-a----- 400.00m                                                     /dev/sdn1(100)

# up convert to mirror and check device allocation
[root@hayes-02 ~]# lvconvert -m1 --type mirror mirror_sanity/span
  Logical volume mirror_sanity/span being converted.
  mirror_sanity/span: Converted: 10.00%
  mirror_sanity/span: Converted: 100.00%
[root@hayes-02 ~]# lvs -a -o +devices
  LV              VG            Attr       LSize   Pool Origin Data%  Meta%  Move Log         Cpy%Sync Convert Devices                          
  span            mirror_sanity mwi-a-m--- 400.00m                                [span_mlog] 100.00           span_mimage_0(0),span_mimage_1(0)
  [span_mimage_0] mirror_sanity iwi-aom--- 400.00m                                                             /dev/sdk1(100)                   
  [span_mimage_0] mirror_sanity iwi-aom--- 400.00m                                                             /dev/sdn1(100)                   
  [span_mimage_1] mirror_sanity iwi-aom--- 400.00m                                                             /dev/sdn1(149)                   
  [span_mimage_1] mirror_sanity iwi-aom--- 400.00m                                                             /dev/sdk1(151)                   
  [span_mlog]     mirror_sanity lwi-aom---   4.00m                                                             /dev/sdi1(0)                     

# only one PV should have been used in up convert allocation

kernel-4.18.0-48.el8    BUILT: Sat Dec  1 19:25:48 CST 2018
lvm2-2.03.01-1.el8    BUILT: Thu Nov  1 04:29:08 CDT 2018
lvm2-libs-2.03.01-1.el8    BUILT: Thu Nov  1 04:29:08 CDT 2018
lvm2-dbusd-2.03.01-1.el8    BUILT: Thu Nov  1 04:31:09 CDT 2018
device-mapper-1.02.153-1.el8    BUILT: Thu Nov  1 04:29:08 CDT 2018
device-mapper-libs-1.02.153-1.el8    BUILT: Thu Nov  1 04:29:08 CDT 2018
device-mapper-event-1.02.153-1.el8    BUILT: Thu Nov  1 04:29:08 CDT 2018
device-mapper-event-libs-1.02.153-1.el8    BUILT: Thu Nov  1 04:29:08 CDT 2018


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