LVM2 ./WHATS_NEW lib/metadata/mirror.c tools/l ...
CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: jbrassow at sourceware.org 2010-08-02 21:07:41
Modified files:
. : WHATS_NEW lib/metadata : mirror.c tools : lvconvert.c
Log message:
Taka's fix for handling failure of all mirrored log devices and all but one mirror leg.
<patch header>
To handle a double failure of a mirrored log, Jon's two patches are commited, however, lvconvert command can't still handle an error when mirror leg and mirrored log got failure at the same time.
[Patch]: Handle both devices of a mirrored log failing (bug 607347)
posted: https://www.redhat.com/archives/lvm-devel/2010-July/msg00009.html
commit: https://www.redhat.com/archives/lvm-devel/2010-July/msg00027.html
[Patch]: Handle both devices of a mirrored log failing (bug 607347) - additional fix
posted: https://www.redhat.com/archives/lvm-devel/2010-July/msg00093.html
commit: https://www.redhat.com/archives/lvm-devel/2010-July/msg00101.html
In the second patch, the target type of mirrored log is replaced with error target when remove_log is set to 1, but this procedure should be also used in other cases such as the number of mirror leg is 1. This patch relocates the procedure to the main path.
In addition, I added following three changes.
- Removed tmp_orphan_lvs handling procedure
It seems that _delete_lv() can handle detached_log_lv properly without adding mirror legs in mirrored log to tmp_orphan_lvs. Therefore, I removed the procedure.
- Removed vg_write()/vg_commit()
Metadata is saved by vg_write()/vg_commit() just after detached_log_lv is handled. Therefore, I removed vg_write()/vg_commit().
- With Jon's second patch, we think that we don't have to call remove_mirror_log() in _lv_update_mirrored_log() because will be handled remove_mirror_images() in _lvconvert_mirrors_repaire(). </patch header>
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1687&r2=1.1688
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/mirror.c.diff?cvsroot=lvm2&r1=1.129&r2=1.130
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvconvert.c.diff?cvsroot=lvm2&r1=1.142&r2=1.143
WHATS_NEW +1 -0
@@ -1,5 +1,6 @@ Version 2.02.73 - ================================ + Handle failure of all mirrored log devices and all but one mirror leg. Disallow 'mirrored' log type for cluster mirrors. Do not use VPATH in include/Makefile. Fix exported_symbols generation to use standard compiler arguments.
lib/metadata/mirror.c +36 -60
107 lines not on this page · raw message
tools/lvconvert.c +10 -6
@@ -696,6 +696,13 @@int old_log_count;struct logical_volume *log_lv; +/* +* When log_count is 0, mirrored log doesn't need to be +* updated here but it will be removed later. +*/ +if (!log_count) +return 1 ; + log_lv =first_seg (_original_lv (lv))->log_lv;if (!log_lv || !(log_lv->status &MIRRORED ))return 1 ;
@@ -705,12 +712,9 @@return 1 ;/* Reducing redundancy of the log */ -if (log_count) -return remove_mirror_images (log_lv, log_count, - is_mirror_image_removable, - operable_pvs,0U ); - -return remove_mirror_log (lv->vg->cmd, lv, operable_pvs); +return remove_mirror_images (log_lv, log_count, + is_mirror_image_removable, + operable_pvs,0U ); } static int _lv_update_log_type(struct cmd_context *cmd,
Bug? in allocation of pvs in a striped mirror using lvcreate
I was experimenting with lvs and ran the following lvcreate command. The issue is that at least two physical volumes are spread between mirrors. Devices /dev/sdb5 and /dev/sdb6 are part of both lvol0_mimage_0 and lvol0_mimage_1. I tried diffent "-alloc" values but nothing changed. In my testing I had all the pvs on one drive but of course I wouldn't do that on a real server.
lvs --version
LVM version: 2.02.73(2)-cvs (2010-07-28)
Library version: 1.02.54-cvs (2010-07-28)
Driver version: 4.15.0
lvcreate --stripes 2 --mirrors 1 --mirrorlog disk --alloc normal vg01 --extents 14848
lvs --segments --all -o +devices
LV VG Attr #Str Type SSize Devices lvol0 vg01 mwn-a- 2 mirror 928.00m lvol0_mimage_0(0),lvol0_mimage_1(0) [lvol0_mimage_0] vg01 Iwi-ao 2 striped 824.00m /dev/sdb9(0),/dev/sdb14(0) [lvol0_mimage_0] vg01 Iwi-ao 2 striped 104.00m /dev/sdb5(0),/dev/sdb6(0) [lvol0_mimage_1] vg01 Iwi-ao 2 striped 464.00m /dev/sdb17(0),/dev/sdb13(0) [lvol0_mimage_1] vg01 Iwi-ao 2 striped 176.00m /dev/sdb11(0),/dev/sdb17(3712) [lvol0_mimage_1] vg01 Iwi-ao 2 striped 112.00m /dev/sdb15(0),/dev/sdb6(832) [lvol0_mimage_1] vg01 Iwi-ao 2 striped 80.00m /dev/sdb12(0),/dev/sdb5(832) [lvol0_mimage_1] vg01 Iwi-ao 2 striped 72.00m /dev/sdb10(0),/dev/sdb11(1408) [lvol0_mimage_1] vg01 Iwi-ao 2 striped 24.00m /dev/sdb7(0),/dev/sdb8(0) [lvol0_mlog] vg01 lwn-ao 1 linear 64.00k /dev/sdb16(0)
pvs -o +lv_name
PV VG Fmt Attr PSize PFree LV /dev/sdb10 vg01 lvm2 a- 36.00m 0 [lvol0_mimage_1] /dev/sdb11 vg01 lvm2 a- 124.00m 0 [lvol0_mimage_1] /dev/sdb11 vg01 lvm2 a- 124.00m 0 [lvol0_mimage_1] /dev/sdb12 vg01 lvm2 a- 44.00m 4.00m [lvol0_mimage_1] /dev/sdb12 vg01 lvm2 a- 44.00m 4.00m /dev/sdb13 vg01 lvm2 a- 232.00m 0 [lvol0_mimage_1] /dev/sdb14 vg01 lvm2 a- 412.00m 0 [lvol0_mimage_0] /dev/sdb15 vg01 lvm2 a- 76.00m 20.00m [lvol0_mimage_1] /dev/sdb15 vg01 lvm2 a- 76.00m 20.00m /dev/sdb16 vg01 lvm2 a- 4.00m 3.94m [lvol0_mlog] /dev/sdb16 vg01 lvm2 a- 4.00m 3.94m /dev/sdb17 vg01 lvm2 a- 320.00m 0 [lvol0_mimage_1] /dev/sdb17 vg01 lvm2 a- 320.00m 0 [lvol0_mimage_1] /dev/sdb5 vg01 lvm2 a- 92.00m 0 [lvol0_mimage_0] /dev/sdb5 vg01 lvm2 a- 92.00m 0 [lvol0_mimage_1] /dev/sdb6 vg01 lvm2 a- 108.00m 0 [lvol0_mimage_0] /dev/sdb6 vg01 lvm2 a- 108.00m 0 [lvol0_mimage_1] /dev/sdb7 vg01 lvm2 a- 12.00m 0 [lvol0_mimage_1] /dev/sdb8 vg01 lvm2 a- 28.00m 16.00m [lvol0_mimage_1] /dev/sdb8 vg01 lvm2 a- 28.00m 16.00m /dev/sdb9 vg01 lvm2 a- 420.00m 8.00m [lvol0_mimage_0] /dev/sdb9 vg01 lvm2 a- 420.00m 8.00m
Bug? in allocation of pvs in a striped mirror using lvcreate
Quoted 5 lines · ben
I was experimenting with lvs and ran the following lvcreate command. The issue is that at least two physical volumes are spread between mirrors. Devices
/dev/sdb5and/dev/sdb6are part of bothlvol0_mimage_0andlvol0_mimage_1. I tried diffent "-alloc" values but nothing changed. In my testing I had all the pvs on one drive but of course I wouldn't do that on a real server.
It's going to take a while to improve the layouts it picks. There are some missing policies we still need.
But it's worth experimenting with different ways of creating the device. E.g. Starting with a shorter device and extending it; or starting with a striped device and turning it into a mirror; specifying which PVs to use on the command line.
There's normally a way to get the layout you want, but if all else fails, you can fix it up by hand (backup, edit, restore).
Alasdair