[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[lvm-devel] [PATCH] restore the "removemissing" behaviour of lvconvert --repair --use-policies



When we are doing lvconvert --repair --use-policies, which is the
combination that is used in dmeventd, at the end of the repair, we clean
up any bad (missing) PVs from the VG that have become empty. In common
cases, this leads to a clean and consistent VG after a repair, with no
missing PVs in it.

This feature has regressed with the mirroredlog patches for lvconvert.

I conjecture, that this patch should fix Corey's RHBZ 606528 (it is not
entirely clear what exactly happened there yet, but I believe this could
definitely explain the behaviour).

Yours,
   Petr.

Index: tools/lvconvert.c
===================================================================
RCS file: /cvs/lvm2/LVM2/tools/lvconvert.c,v
retrieving revision 1.135
diff -u -p -r1.135 lvconvert.c
--- tools/lvconvert.c	23 Jun 2010 20:32:29 -0000	1.135
+++ tools/lvconvert.c	30 Jun 2010 20:38:10 -0000
@@ -790,7 +790,6 @@ static void _remove_missing_empty_pv(str
 			stack;
 			return;
 		}
-
 		log_warn("%d missing and now unallocated Physical Volumes removed from VG.", removed);
 	}
 }
@@ -1177,7 +1176,6 @@ static int _lvconvert_mirrors_repair(str
 	int replace_log = 0;
 	int replace_mirrors = 0;
 	uint32_t new_log_count, log_count;
-	struct dm_list *failed_pvs = NULL;
 	struct logical_volume *log_lv;
 
 	cmd->handles_missing_pvs = 1;
@@ -1232,14 +1230,14 @@ static int _lvconvert_mirrors_repair(str
 	/*
 	 * First phase - remove faulty devices
 	 */
-	if (!(failed_pvs = _failed_pv_list(lv->vg)))
+	if (!(lp->failed_pvs = _failed_pv_list(lv->vg)))
 		return_0;
 
 	/*
 	 * We must adjust the log first, or the entire mirror
 	 * will get stuck during a suspend.
 	 */
-	if (!_lv_update_mirrored_log(lv, failed_pvs, new_log_count))
+	if (!_lv_update_mirrored_log(lv, lp->failed_pvs, new_log_count))
 		return 0;
 
 	if (lp->mirrors == 1)
@@ -1252,7 +1250,7 @@ static int _lvconvert_mirrors_repair(str
 			return 0;
 	}
 
-	if (!_lv_update_log_type(cmd, lp, lv, failed_pvs,
+	if (!_lv_update_log_type(cmd, lp, lv, lp->failed_pvs,
 				 new_log_count))
 		return 0;
 
Index: test/t-lvconvert-repair-dmeventd.sh
===================================================================
RCS file: /cvs/lvm2/LVM2/test/t-lvconvert-repair-dmeventd.sh,v
retrieving revision 1.2
diff -u -p -r1.2 t-lvconvert-repair-dmeventd.sh
--- test/t-lvconvert-repair-dmeventd.sh	12 May 2010 11:23:16 -0000	1.2
+++ test/t-lvconvert-repair-dmeventd.sh	30 Jun 2010 20:38:10 -0000
@@ -24,3 +24,17 @@ sleep 3 # FIXME: need a "poll" utility, 
 enable_dev $dev2 $dev4
 check mirror $vg 4way
 check mirror_legs $vg 4way 2
+
+vgextend $vg $dev2 $dev4
+
+lvcreate -m 1 --ig -L 1 -n 2way $vg
+lvchange --monitor y $vg/2way
+disable_dev $dev1
+mkfs.ext2 $DM_DEV_DIR/$vg/2way
+mkfs.ext2 $DM_DEV_DIR/$vg/4way
+sleep 3 # FIXME: need a "poll" utility, akin to "check"
+enable_dev $dev1
+check linear $vg 2way
+check linear $vg 4way
+
+vgextend $vg $dev1

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]