Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=c144305d3e6b68bc…
Commit: c144305d3e6b68bc9f85641a5038013fdc07b5a2
Parent: 7c6b14b74f88a58a9589922a3fa7be18334f3936
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Dec 4 17:05:44 2013 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Dec 4 17:10:31 2013 +0100
tests: update pvmove-test
Do not lock test when trying to grab cluster lock.
There seems to be still something weird in this test
so it still needs some inspection.
---
test/shell/pvmove-restart.sh | 23 ++++++++++++++++++++++-
1 files changed, 22 insertions(+), 1 deletions(-)
diff --git a/test/shell/pvmove-restart.sh b/test/shell/pvmove-restart.sh
index c8da45e..e1d5381 100644
--- a/test/shell/pvmove-restart.sh
+++ b/test/shell/pvmove-restart.sh
@@ -33,16 +33,37 @@ PVMOVE=$!
# Let's wait a bit till pvmove starts and kill it
sleep 1
kill -9 $PVMOVE
+wait
# Simulate reboot - forcibly remove related devices
dmsetup remove $vg-$lv1
dmsetup remove $vg-pvmove0
+if test -e LOCAL_CLVMD ; then
+ # giveup all clvmd locks (faster then restarting clvmd)
+ # no deactivation happen, nodes are already removed
+ vgchange -an $vg
+ # Restart clvmd
+ #kill $(cat LOCAL_CLVMD)
+ #while test -e "/var/run/clvmd.pid"; do echo -n .; sleep .1; done # wait for the pid removal
+ #aux prepare_clvmd
+fi
+
+if test -e LOCAL_LVMETAD ; then
+ # Restart lvmetad
+ kill $(cat LOCAL_LVMETAD)
+ aux prepare_lvmetad
+fi
+
# Only PVs should be left in table...
dmsetup table
# Restart pvmove
-vgchange -ay $vg
+# use exclusive activation to have usable pvmove without cmirrord
+#vgchange -vvvv -ay $vg
+vgchange -aey $vg
+dmsetup table
+#pvmove
pvmove --abort
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=598c82fc077c8a3e…
Commit: 598c82fc077c8a3edfbdb664b41efd89d05b5a10
Parent: 28939dba09fcd36cd0e4e470e73b172f19dd45e8
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Nov 28 23:22:03 2013 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Dec 4 17:09:51 2013 +0100
vgchange: move detection of remote exlusivness
Since activation takes only read-lock, there could be
multiple activation running in parallel.
So instead of checking before taking any real lock,
let the locking resolve the problem and just
detect if the reason for failure has been remote
exlusive activation.
It should be also faster, since each activation does
not need to do explicit lock query.
---
WHATS_NEW | 1 +
tools/vgchange.c | 22 +++++++++++-----------
2 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 5d41700..60571ff 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.105 -
=====================================
+ Test for remote exclusive activation after activation fails.
Support lvconvert --merge for thin snapshots.
Add support to read thin device id from table line entry.
Drop extra test for origin when testing merging origin in lv_refresh().
diff --git a/tools/vgchange.c b/tools/vgchange.c
index b50b444..f9811d2 100644
--- a/tools/vgchange.c
+++ b/tools/vgchange.c
@@ -121,16 +121,6 @@ static int _activate_lvs_in_vg(struct cmd_context *cmd, struct volume_group *vg,
((lv->status & PVMOVE) ))
continue;
- /*
- * If the LV is active exclusive remotely,
- * then ignore it here
- */
- if (lv_is_active_exclusive_remotely(lv)) {
- log_verbose("%s/%s is exclusively active on"
- " a remote node", vg->name, lv->name);
- continue;
- }
-
if (lv_activation_skip(lv, activate, arg_count(cmd, ignoreactivationskip_ARG), 0)) {
log_verbose("ACTIVATION_SKIP flag set for LV %s/%s, skipping activation.",
lv->vg->name, lv->name);
@@ -144,7 +134,17 @@ static int _activate_lvs_in_vg(struct cmd_context *cmd, struct volume_group *vg,
expected_count++;
if (!lv_change_activate(cmd, lv, activate)) {
- stack;
+ if (!lv_is_active_exclusive_remotely(lv))
+ stack;
+ else {
+ /*
+ * If the LV is active exclusive remotely,
+ * then ignore it here
+ */
+ log_verbose("%s/%s is exclusively active on"
+ " a remote node", vg->name, lv->name);
+ expected_count--; /* not accounted */
+ }
continue;
}
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=971ab733b74e0ffe…
Commit: 971ab733b74e0ffecc3f9f60af48628cd3fba1db
Parent: ff112eee181748dbf827d91a7ebf0c0f1d7878a0
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Nov 29 21:25:58 2013 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Dec 4 14:30:26 2013 +0100
thin: activation of merging thin snapshot
For merging thin snapshot we have to do couple extra
checks before we allow this operation.
We pretend thin-snapshot and thin-origin
are tied together and we have to properly
maintain locking.
---
tools/toollib.c | 30 +++++++++++++++++++++++++++++-
1 files changed, 29 insertions(+), 1 deletions(-)
diff --git a/tools/toollib.c b/tools/toollib.c
index 183d832..65a7089 100644
--- a/tools/toollib.c
+++ b/tools/toollib.c
@@ -1403,6 +1403,34 @@ int vgcreate_params_set_from_args(struct cmd_context *cmd,
int lv_change_activate(struct cmd_context *cmd, struct logical_volume *lv,
activation_change_t activate)
{
+ int r = 1;
+
+ if (lv_is_merging_origin(lv)) {
+ /*
+ * For merging origin, its snapshot must be inactive.
+ * If it's still active and cannot be deactivated
+ * activation or deactivation of origin fails!
+ *
+ * When origin is deactivated and merging snapshot is thin
+ * it allows to deactivate origin, but still report error,
+ * since the thin snapshot remains active.
+ *
+ * User could retry to deactivate it with another
+ * deactivation of origin, which is the only visible LV
+ */
+ if (!deactivate_lv(cmd, find_snapshot(lv)->lv)) {
+ if ((activate != CHANGE_AN) && (activate != CHANGE_ALN)) {
+ log_error("Refusing to activate merging \"%s\" while snapshot \"%s\" is still active.",
+ lv->name, find_snapshot(lv)->lv->name);
+ return 0;
+ }
+
+ log_error("Cannot fully deactivate merging origin \"%s\" while snapshot \"%s\" is still active.",
+ lv->name, find_snapshot(lv)->lv->name);
+ r = 0; /* and continue to deactivate origin... */
+ }
+ }
+
if (!lv_active_change(cmd, lv, activate))
return_0;
@@ -1412,7 +1440,7 @@ int lv_change_activate(struct cmd_context *cmd, struct logical_volume *lv,
(lv->status & (PVMOVE|CONVERTING|MERGING)))
lv_spawn_background_polling(cmd, lv);
- return 1;
+ return r;
}
int lv_refresh(struct cmd_context *cmd, struct logical_volume *lv)