1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

Fix issue preventing cluster mirror creation.

Mirrors used to be created by first creating a linear device and then adding
the other images plus the log.  Now mirrors are created by creating all the
images in one go and then adding the log separately.  The new way ran into
the condition that cluster mirrors cannot change the log type (in the case
of creation, from core -> disk) while the mirror is not active.  (It isn't
active because it is in the process of being created.)  The reason this
condition is in place is because a remote node may have the mirror active, and
we don't want to alter the log underneath it.

What we really needed was a way of checking if the mirror was active remotely
but not locally, and in that case do not allow a change of the log.  I've added
this check, and cluster mirrors can now be created again.
This commit is contained in:
Jonathan Earl Brassow 2011-06-22 21:31:21 +00:00
parent 901e7257d1
commit 9e277b9e2c
4 changed files with 7 additions and 13 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.86 -
=================================
Fix issue preventing cluster mirror creation.
Disable udev fallback by default and add activation/udev_fallback to lvm.conf.
Call vg_mark_partial_lvs() before VG structure is returned from the cache.
Remove unused internal flag ACTIVATE_EXCL from the code.

View File

@ -823,13 +823,11 @@ int lv_is_active(struct logical_volume *lv)
return _lv_is_active(lv, NULL, NULL);
}
/*
int lv_is_active_locally(struct logical_volume *lv)
int lv_is_active_but_not_locally(struct logical_volume *lv)
{
int l;
return _lv_is_active(lv, &l, NULL) && l;
return _lv_is_active(lv, &l, NULL) && !l;
}
*/
int lv_is_active_exclusive_locally(struct logical_volume *lv)
{

View File

@ -101,6 +101,7 @@ int lvs_in_vg_activated(struct volume_group *vg);
int lvs_in_vg_opened(const struct volume_group *vg);
int lv_is_active(struct logical_volume *lv);
int lv_is_active_but_not_locally(struct logical_volume *lv);
int lv_is_active_exclusive_locally(struct logical_volume *lv);
int lv_is_active_exclusive_remotely(struct logical_volume *lv);

View File

@ -1857,15 +1857,9 @@ int add_mirror_log(struct cmd_context *cmd, struct logical_volume *lv,
return 0;
}
/*
* We are unable to convert the log of inactive cluster mirrors
* due to the inability to detect whether the mirror is active
* on remote nodes (even though it is inactive on this node)
*/
if (vg_is_clustered(lv->vg) &&
!(lv_info(cmd, lv, 0, &info, 0, 0) && info.exists)) {
log_error("Unable to convert the log of inactive "
"cluster mirror %s", lv->name);
if (lv_is_active_but_not_locally(lv)) {
log_error("Unable to convert the log of a mirror, %s, that is "
"active remotely but not locally", lv->name);
return 0;
}