Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=08ac12d5e7dd8375…
Commit: 08ac12d5e7dd8375fda49dc44c4ee924dcf05b1b
Parent: c0e17bca90326104020ba31b00fb9f66abf278b6
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Fri Jan 9 11:57:25 2015 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Fri Jan 9 11:57:25 2015 +0100
WHATS_NEW: line for previous commit
---
WHATS_NEW | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 419f9c9..893c382 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.115 -
=====================================
+ Do not filter out snapshot origin LVs as unusable devices for an LVM stack.
Fix incorrect rimage names when converting from mirror to raid1 LV (2.02.112).
Avoid excessive re-reading of metadata and related error messages in pvremove.
Check for cmirror availability during cluster mirror creation and activation.
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=c0e17bca90326104…
Commit: c0e17bca90326104020ba31b00fb9f66abf278b6
Parent: 9dbeacf303f34d4a9f4ccad666e44ca55b83fada
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Fri Jan 9 11:24:16 2015 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Fri Jan 9 11:24:16 2015 +0100
dev_manager: do not mark snapshot origins as unusable devices just because of possible blocked mirror underneath
At first, all snapshot-origins where marked as unusable unconditionally
here, but we can't cut off whole snapshot-origin use in a stack just
because of this possible mirror state. This whole "device_is_usable"
check was even incorrectly part of persistent filter before commit
a843d0d97c66aae1872c05b0f6cf4bda176aae2 (where filter cleanup was
done).
The persistent filter is used only if obtain_device_list_from_udev=0,
which means that the former check for snapshot-origin here had not even
been hit with default configuration for a few years before commit
a843d0d97c66aae1872c05b0f6cf4bda176aae2 (the check for snapshot-origin and
skipping of this LV was introduced with commit a71d6051ed3d72af6895733c599cc44b49f24dbb
back in 2010).
The obtain_device_list_from_udev=1 (and hence not using persistent
filter and hence not hitting this check for snapshot-origins and skipping) has been
in action since commit edcda01a1e18af6599275801a8237fe10112ed6f (that is 2011).
So for 3 years this condition was not even checked with default configuration,
making it superfluous.
This all changed in 2014 with commit 8a843d0d97c66aae1872c05b0f6cf4bda176aae2
where "filter-usable" is introduced and since then all snapshot-origins
have been marked as unusable more often than before and making snapshot-origins
practically unusable in a stack.
This patch removes this incorrect check from commit a71d6051ed3d72af6895733c599cc44b49f24dbb
which caused snapshot-origins to be unusable more often recently.
If we want to fix this eventually in a correct way, we need to look
down the stack and if snapshot-origin is hit and there's a blocked
mirror underneath, only then mark the device as unusable. But mirrors
in stack are not supported anymore so it's questionable whether it's
worth spending more time on this at all...
---
lib/activate/dev_manager.c | 20 ++++++++++++--------
1 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c
index e336933..18092db 100644
--- a/lib/activate/dev_manager.c
+++ b/lib/activate/dev_manager.c
@@ -547,18 +547,22 @@ int device_is_usable(struct device *dev, struct dev_usable_check_params check)
}
/*
- * Snapshot origin could be sitting on top of a mirror which
- * could be blocking I/O. Skip snapshot origins entirely for
- * now.
- *
- * FIXME: rather than skipping origin, check if mirror is
- * underneath and if the mirror is blocking I/O.
+ * FIXME: Snapshot origin could be sitting on top of a mirror
+ * which could be blocking I/O. We should add a check for the
+ * stack here and see if there's blocked mirror underneath.
+ * Currently, mirrors used as origin or snapshot is not
+ * supported anymore and in general using mirrors in a stack
+ * is disabled by default (with a warning that if enabled,
+ * it could cause various deadlocks).
+ * This is former check used, but it's not correct as it
+ * disables snapshot-origins to be used in a stack in
+ * general, not just over mirrors!
*/
- if (check.check_suspended && target_type && !strcmp(target_type, "snapshot-origin")) {
+ /*if (check.check_suspended && target_type && !strcmp(target_type, "snapshot-origin")) {
log_debug_activation("%s: Snapshot-origin device %s not usable.",
dev_name(dev), name);
goto out;
- }
+ }*/
if (target_type && strcmp(target_type, "error"))
only_error_target = 0;
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=ff1eca3b6f1b4015…
Commit: ff1eca3b6f1b40158fa5a5877b1ad6de72e4ed1e
Parent: e97023804a8aa94d723025506fa23cf4a5c323e9
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Wed Jan 7 10:52:38 2015 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Wed Jan 7 11:16:19 2015 +0100
mirror: do not try to reactivate inactive mirror when removing its LVs which have missing PVs
When mirror has missing PVs and there are mirror images on those missing
PVs, we delete the images and during this delete operation, we also
reactivate the LV. But if we're trying to reactivate the LV in cluster
which is not active and at the same time cmirrord is not running (which
is OK since we may have created the mirror LV as inactive), we end up
with:
"Error locking on node <node_name>: Shared cluster mirrors are not available."
That is because we're trying to activate the mirror LV without cmirrord.
However, there's no need to do this reactivation if the mirror LV (and
hence it's sub LVs) were not activated before.
This issue caused failure in mirror-vgreduce-removemissing.sh test
recently with this sequence (excerpt from the test script):
prepare_lvs_
lvcreate -an -Zn -l2 --type mirror -m1 --nosync -n $lv1 $vg "$dev1" $dev2" "$dev3":$BLOCKS
mimages_are_on_ $lv1 "$dev1" "$dev2"
mirrorlog_is_on_ $lv1 "$dev3"
aux disable_dev "$dev2"
vgreduce --removemissing --force $vg
The important thing about that test is that we're not running cmirrord,
we're activating the mirror with "-an" so it's inactive and then
vgreduce --removemissing tries to reactivate the mirror images
as part of the _delete_lv function call inside and since cmirrord
is not running, we end up with the "Shared cluster mirrors are not
available." error.
---
lib/metadata/mirror.c | 32 +++++++++++++++++++-------------
1 files changed, 19 insertions(+), 13 deletions(-)
diff --git a/lib/metadata/mirror.c b/lib/metadata/mirror.c
index bac1ffb..edbf7d4 100644
--- a/lib/metadata/mirror.c
+++ b/lib/metadata/mirror.c
@@ -420,7 +420,8 @@ static int _activate_lv_like_model(struct logical_volume *model,
/*
* Delete independent/orphan LV, it must acquire lock.
*/
-static int _delete_lv(struct logical_volume *mirror_lv, struct logical_volume *lv)
+static int _delete_lv(struct logical_volume *mirror_lv, struct logical_volume *lv,
+ int reactivate)
{
struct cmd_context *cmd = mirror_lv->vg->cmd;
struct dm_str_list *sl;
@@ -440,15 +441,17 @@ static int _delete_lv(struct logical_volume *mirror_lv, struct logical_volume *l
}
}
- /* FIXME: the 'model' should be 'mirror_lv' not 'lv', I think. */
- if (!_activate_lv_like_model(lv, lv))
- return_0;
+ if (reactivate) {
+ /* FIXME: the 'model' should be 'mirror_lv' not 'lv', I think. */
+ if (!_activate_lv_like_model(lv, lv))
+ return_0;
- /* FIXME Is this superfluous now? */
- sync_local_dev_names(cmd);
+ /* FIXME Is this superfluous now? */
+ sync_local_dev_names(cmd);
- if (!deactivate_lv(cmd, lv))
- return_0;
+ if (!deactivate_lv(cmd, lv))
+ return_0;
+ }
if (!lv_remove(lv))
return_0;
@@ -799,11 +802,11 @@ static int _split_mirror_images(struct logical_volume *lv,
}
/* Remove original mirror layer if it has been converted to linear */
- if (sub_lv && !_delete_lv(lv, sub_lv))
+ if (sub_lv && !_delete_lv(lv, sub_lv, 1))
return_0;
/* Remove the log if it has been converted to linear */
- if (detached_log_lv && !_delete_lv(lv, detached_log_lv))
+ if (detached_log_lv && !_delete_lv(lv, detached_log_lv, 1))
return_0;
return 1;
@@ -852,6 +855,7 @@ static int _remove_mirror_images(struct logical_volume *lv,
struct lv_list *lvl;
struct dm_list tmp_orphan_lvs;
uint32_t orig_removed = num_removed;
+ int reactivate;
if (removed)
*removed = 0;
@@ -864,6 +868,7 @@ static int _remove_mirror_images(struct logical_volume *lv,
if (collapse && (old_area_count - num_removed != 1)) {
log_error("Incompatible parameters to _remove_mirror_images");
return 0;
+
}
num_removed = 0;
@@ -1093,16 +1098,17 @@ static int _remove_mirror_images(struct logical_volume *lv,
}
/* Save or delete the 'orphan' LVs */
+ reactivate = lv_is_active(lv_lock_holder(lv));
if (!collapse) {
dm_list_iterate_items(lvl, &tmp_orphan_lvs)
- if (!_delete_lv(lv, lvl->lv))
+ if (!_delete_lv(lv, lvl->lv, reactivate))
return_0;
}
- if (temp_layer_lv && !_delete_lv(lv, temp_layer_lv))
+ if (temp_layer_lv && !_delete_lv(lv, temp_layer_lv, reactivate))
return_0;
- if (detached_log_lv && !_delete_lv(lv, detached_log_lv))
+ if (detached_log_lv && !_delete_lv(lv, detached_log_lv, reactivate))
return_0;
/* Mirror with only 1 area is 'in sync'. */
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=509650ec4cb1ef65…
Commit: 509650ec4cb1ef65e277870e96976d7dd8882170
Parent: cba6186325f0d5806cf1ddec276b3bb8e178687a
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Tue Jan 6 09:59:04 2015 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Tue Jan 6 09:59:04 2015 +0100
cmirror: do not check for cmirror availability when creating deactivated cluster mirrors
When creating cluster mirrors while they're not supposed to be activated
immediately after creation, we don't need to check for cmirrord availability.
We can just create these mirrors and let the check to be done on activation
later on. This is addendum for commit cba6186325f0d5806cf1ddec276b3bb8e178687a.
---
lib/metadata/lv_manip.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index 260a76a..457cf9e 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -6817,8 +6817,8 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg,
if (!(create_segtype = get_segtype_from_string(vg->cmd, "striped")))
return_0;
} else if (seg_is_mirrored(lp) || seg_is_raid(lp)) {
- if (lp->activate != CHANGE_AEY && vg_is_clustered(vg) &&
- seg_is_mirrored(lp) && !seg_is_raid(lp) &&
+ if (is_change_activating(lp->activate) && (lp->activate != CHANGE_AEY) &&
+ vg_is_clustered(vg) && seg_is_mirrored(lp) && !seg_is_raid(lp) &&
!cluster_mirror_is_available(vg->cmd)) {
log_error("Shared cluster mirrors are not available.");
return NULL;