Skip to contentSkip to conversation

LVM: mirrored log patches

PATCH New Jonathan Brassow 2 participants 3 messages Mar 5, 2010 – Mar 16, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 LVM: mirrored log patches

There will likely be at least one more round of these patches - mostly to clean-up the last patch I've been working on.

This round includes changes to the _lvconvert_mirrors function to allow it to handle the repair conversions necessary for 'lvconvert' to accept only top-level LVs. It also includes suggested changes from Taka (thanks for those!).

brassow

#1 lore raw

PATCH 1/1 LVM: mirrored log patches

Quoted 7 lines · Jonathan Brassow

There will likely be at least one more round of these patches - mostly to clean-up the last patch I've been working on.

This round includes changes to the _lvconvert_mirrors function to allow it to handle the repair conversions necessary for 'lvconvert' to accept only top-level LVs. It also includes suggested changes from Taka (thanks for those!).

I didn't have time to investigate the root cause, but let me report an error case I found. When the secondary log device has a failure, lvconvert couldn't recover the mirror device, but other cases, the primary mirror leg failure, the secondary mirror leg failure and the primary log device failure worked fine.

This is reproduction steps.

1. create mirror device

vg00-lv00 (253:5)

 |-vg00-lv00_mimage_1 (253:4)
 |  `- (8:48)
 |-vg00-lv00_mimage_0 (253:3)
 |  `- (8:32)
 `-vg00-lv00_mlog (253:2)
    |-vg00-lv00_mlog_mimage_1 (253:1)
    |  `- (8:80)
    `-vg00-lv00_mlog_mimage_0 (253:0)
       `- (8:64)

2. kill dmeventd

3. disable the secondary device of the mirrored log

# echo offline > /sys/block/sdf/device/state

4. write to the mirror device

# dd if=/dev/zero of=/dev/vg00/lv00 bs=4096 count=1
*** hungup ***

5. check the device status

# dmsetup status
vg00-lv00_mimage_1: 0 24576 linear 
vg00-lv00_mlog_mimage_1: 0 8192 linear 
vg00-lv00_mimage_0: 0 24576 linear 
vg00-lv00_mlog_mimage_0: 0 8192 linear 
vg00-lv00_mlog: 0 8192 mirror 2 253:0 253:1 7/8 1 AD 1 core
vg00-lv00: 0 24576 mirror 2 253:3 253:4 24/24 1 AA 3 disk 253:2 A

6. execute lvconvert command

# lvconvert --config devices{ignore_suspended_devices=1} --repair --use-policies vg00/lv00
  Couldn't find device with uuid 'KxT1Vd-czbx-mWS1-1F8E-WO3k-rvUA-z41gwY'.
  Couldn't find device with uuid 'KxT1Vd-czbx-mWS1-1F8E-WO3k-rvUA-z41gwY'.
  Couldn't find device with uuid 'KxT1Vd-czbx-mWS1-1F8E-WO3k-rvUA-z41gwY'.
  Mirror log status: 1 of 2 images failed
  Couldn't find device with uuid 'KxT1Vd-czbx-mWS1-1F8E-WO3k-rvUA-z41gwY'.
  Couldn't find device with uuid 'KxT1Vd-czbx-mWS1-1F8E-WO3k-rvUA-z41gwY'.
  Couldn't find device with uuid 'KxT1Vd-czbx-mWS1-1F8E-WO3k-rvUA-z41gwY'.
  Couldn't find device with uuid 'KxT1Vd-czbx-mWS1-1F8E-WO3k-rvUA-z41gwY'.
  Couldn't find device with uuid 'KxT1Vd-czbx-mWS1-1F8E-WO3k-rvUA-z41gwY'.
  Couldn't find device with uuid 'KxT1Vd-czbx-mWS1-1F8E-WO3k-rvUA-z41gwY'.
  Couldn't find device with uuid 'KxT1Vd-czbx-mWS1-1F8E-WO3k-rvUA-z41gwY'.
  Couldn't find device with uuid 'KxT1Vd-czbx-mWS1-1F8E-WO3k-rvUA-z41gwY'.
  Couldn't find device with uuid 'KxT1Vd-czbx-mWS1-1F8E-WO3k-rvUA-z41gwY'.
  Couldn't find device with uuid 'KxT1Vd-czbx-mWS1-1F8E-WO3k-rvUA-z41gwY'.
  Couldn't find device with uuid 'KxT1Vd-czbx-mWS1-1F8E-WO3k-rvUA-z41gwY'.
  Couldn't find device with uuid 'KxT1Vd-czbx-mWS1-1F8E-WO3k-rvUA-z41gwY'.
  Couldn't find device with uuid 'KxT1Vd-czbx-mWS1-1F8E-WO3k-rvUA-z41gwY'.
  Couldn't find device with uuid 'KxT1Vd-czbx-mWS1-1F8E-WO3k-rvUA-z41gwY'.
  Couldn't find device with uuid 'KxT1Vd-czbx-mWS1-1F8E-WO3k-rvUA-z41gwY'.
  Couldn't find device with uuid 'KxT1Vd-czbx-mWS1-1F8E-WO3k-rvUA-z41gwY'.
  Couldn't find device with uuid 'KxT1Vd-czbx-mWS1-1F8E-WO3k-rvUA-z41gwY'.
  Couldn't find device with uuid 'KxT1Vd-czbx-mWS1-1F8E-WO3k-rvUA-z41gwY'.
  device-mapper: create ioctl failed: Device or resource busy
  Problem reactivating lv00_mlog
  WARNING: dev_open(/etc/lvm/lvm.conf) called while suspended

After this steps, dmsetup vg00-lv00 also hungup.
I'll report if I get more information.

Thanks,
Taka

#2 lore raw

PATCH 1/1 LVM: mirrored log patches

In reply to Jonathan Brassow
Quoted 7 lines · Jonathan Brassow

There will likely be at least one more round of these patches - mostly to clean-up the last patch I've been working on.

This round includes changes to the _lvconvert_mirrors function to allow it to handle the repair conversions necessary for 'lvconvert' to accept only top-level LVs. It also includes suggested changes from Taka (thanks for those!).

I checked your patch set. It seems that one of my suggestion has not been implemented yet, and some of my tests failed.

https://www.redhat.com/archives/lvm-devel/2010-February/msg00214.html

In this patch set, _lvconvert_mirrors_aux() repairs in the order of mirror images and mirror log. As I explained in the above url, mirror log should be repaired before mirror images are repaired because the repair procedure of the mirror image calls suspend_lv() and that causes deadlock. The deadlock happens because suspending LV with failed log device doesn't finish.

What do you think calling _lv_update_log_type() before and after repairing mirror legs in _lvconvert_mirrors_aux()?

Other tests worked well so far. Thank you for fixing issues.

Thanks,
Taka