|
|
ed0026 |
commit 7d17d8ab2dd91bdcaf2dea199f2ef66b514daea0
|
|
|
ed0026 |
Author: Andrew Beekhof <andrew@beekhof.net>
|
|
|
ed0026 |
Date: Wed Nov 6 14:15:24 2013 +1100
|
|
|
ed0026 |
|
|
|
ed0026 |
PE: Probe containers not expected to be up
|
|
|
ed0026 |
|
|
|
ed0026 |
RHEL-Only work-around, fixing properly upstream
|
|
|
ed0026 |
|
|
|
ed0026 |
diff --git a/include/crm/pengine/internal.h b/include/crm/pengine/internal.h
|
|
|
ed0026 |
index 7240106..dd52e7f 100644
|
|
|
ed0026 |
--- a/include/crm/pengine/internal.h
|
|
|
ed0026 |
+++ b/include/crm/pengine/internal.h
|
|
|
ed0026 |
@@ -262,4 +262,5 @@ op_digest_cache_t *rsc_action_digest_cmp(resource_t * rsc, xmlNode * xml_op, nod
|
|
|
ed0026 |
|
|
|
ed0026 |
gboolean is_remote_node(xmlNode *xml);
|
|
|
ed0026 |
|
|
|
ed0026 |
+resource_t * rsc_contains_remote_node(pe_working_set_t * data_set, resource_t *rsc);
|
|
|
ed0026 |
#endif
|
|
|
ed0026 |
diff --git a/include/crm/pengine/status.h b/include/crm/pengine/status.h
|
|
|
ed0026 |
index 8eb4a1d..eb52464 100644
|
|
|
ed0026 |
--- a/include/crm/pengine/status.h
|
|
|
ed0026 |
+++ b/include/crm/pengine/status.h
|
|
|
ed0026 |
@@ -183,6 +183,7 @@ struct node_s {
|
|
|
ed0026 |
# define pe_rsc_migrating 0x00400000ULL
|
|
|
ed0026 |
|
|
|
ed0026 |
# define pe_rsc_failure_ignored 0x01000000ULL
|
|
|
ed0026 |
+# define pe_rsc_unexpectedly_running 0x02000000ULL
|
|
|
ed0026 |
|
|
|
ed0026 |
# define pe_rsc_needs_quorum 0x10000000ULL
|
|
|
ed0026 |
# define pe_rsc_needs_fencing 0x20000000ULL
|
|
|
ed0026 |
diff --git a/lib/pengine/unpack.c b/lib/pengine/unpack.c
|
|
|
ed0026 |
index 78ceb85..56ed291 100644
|
|
|
ed0026 |
--- a/lib/pengine/unpack.c
|
|
|
ed0026 |
+++ b/lib/pengine/unpack.c
|
|
|
ed0026 |
@@ -2014,6 +2014,9 @@ unpack_lrm_resources(node_t * node, xmlNode * lrm_rsc_list, pe_working_set_t * d
|
|
|
ed0026 |
{
|
|
|
ed0026 |
xmlNode *rsc_entry = NULL;
|
|
|
ed0026 |
gboolean found_orphaned_container_filler = FALSE;
|
|
|
ed0026 |
+ GListPtr unexpected_containers = NULL;
|
|
|
ed0026 |
+ GListPtr gIter = NULL;
|
|
|
ed0026 |
+ resource_t *remote = NULL;
|
|
|
ed0026 |
|
|
|
ed0026 |
CRM_CHECK(node != NULL, return FALSE);
|
|
|
ed0026 |
|
|
|
ed0026 |
@@ -2025,9 +2028,29 @@ unpack_lrm_resources(node_t * node, xmlNode * lrm_rsc_list, pe_working_set_t * d
|
|
|
ed0026 |
if (crm_str_eq((const char *)rsc_entry->name, XML_LRM_TAG_RESOURCE, TRUE)) {
|
|
|
ed0026 |
resource_t *rsc;
|
|
|
ed0026 |
rsc = unpack_lrm_rsc_state(node, rsc_entry, data_set);
|
|
|
ed0026 |
- if (rsc && is_set(rsc->flags, pe_rsc_orphan_container_filler)) {
|
|
|
ed0026 |
+ if (!rsc) {
|
|
|
ed0026 |
+ continue;
|
|
|
ed0026 |
+ }
|
|
|
ed0026 |
+ if (is_set(rsc->flags, pe_rsc_orphan_container_filler)) {
|
|
|
ed0026 |
found_orphaned_container_filler = TRUE;
|
|
|
ed0026 |
}
|
|
|
ed0026 |
+ if (is_set(rsc->flags, pe_rsc_unexpectedly_running)) {
|
|
|
ed0026 |
+ remote = rsc_contains_remote_node(data_set, rsc);
|
|
|
ed0026 |
+ if (remote) {
|
|
|
ed0026 |
+ unexpected_containers = g_list_append(unexpected_containers, remote);
|
|
|
ed0026 |
+ }
|
|
|
ed0026 |
+ }
|
|
|
ed0026 |
+ }
|
|
|
ed0026 |
+ }
|
|
|
ed0026 |
+
|
|
|
ed0026 |
+ /* If a container resource is unexpectedly up... and the remote-node
|
|
|
ed0026 |
+ * connection resource for that container is not up, the entire container
|
|
|
ed0026 |
+ * must be recovered. */
|
|
|
ed0026 |
+ for (gIter = unexpected_containers; gIter != NULL; gIter = gIter->next) {
|
|
|
ed0026 |
+ remote = (resource_t *) gIter->data;
|
|
|
ed0026 |
+ if (remote->role != RSC_ROLE_STARTED) {
|
|
|
ed0026 |
+ crm_warn("Recovering container resource %s. Resource is unexpectedly running and involves a remote-node.");
|
|
|
ed0026 |
+ set_bit(remote->container->flags, pe_rsc_failed);
|
|
|
ed0026 |
}
|
|
|
ed0026 |
}
|
|
|
ed0026 |
|
|
|
ed0026 |
@@ -2037,7 +2060,7 @@ unpack_lrm_resources(node_t * node, xmlNode * lrm_rsc_list, pe_working_set_t * d
|
|
|
ed0026 |
if (found_orphaned_container_filler) {
|
|
|
ed0026 |
handle_orphaned_container_fillers(lrm_rsc_list, data_set);
|
|
|
ed0026 |
}
|
|
|
ed0026 |
-
|
|
|
ed0026 |
+ g_list_free(unexpected_containers);
|
|
|
ed0026 |
return TRUE;
|
|
|
ed0026 |
}
|
|
|
ed0026 |
|
|
|
ed0026 |
@@ -2366,6 +2389,7 @@ unpack_rsc_op(resource_t * rsc, node_t * node, xmlNode * xml_op,
|
|
|
ed0026 |
case PCMK_OCF_OK:
|
|
|
ed0026 |
if (is_probe && target_rc == 7) {
|
|
|
ed0026 |
task_status_i = PCMK_LRM_OP_DONE;
|
|
|
ed0026 |
+ set_bit(rsc->flags, pe_rsc_unexpectedly_running);
|
|
|
ed0026 |
pe_rsc_info(rsc, "Operation %s found resource %s active on %s",
|
|
|
ed0026 |
task, rsc->id, node->details->uname);
|
|
|
ed0026 |
|
|
|
ed0026 |
diff --git a/lib/pengine/utils.c b/lib/pengine/utils.c
|
|
|
ed0026 |
index 1e3877d..e9997a2 100644
|
|
|
ed0026 |
--- a/lib/pengine/utils.c
|
|
|
ed0026 |
+++ b/lib/pengine/utils.c
|
|
|
ed0026 |
@@ -1776,3 +1776,24 @@ const char *rsc_printable_id(resource_t *rsc)
|
|
|
ed0026 |
}
|
|
|
ed0026 |
return rsc->id;
|
|
|
ed0026 |
}
|
|
|
ed0026 |
+
|
|
|
ed0026 |
+resource_t *
|
|
|
ed0026 |
+rsc_contains_remote_node(pe_working_set_t * data_set, resource_t *rsc)
|
|
|
ed0026 |
+{
|
|
|
ed0026 |
+ if (is_set(data_set->flags, pe_flag_have_remote_nodes) == FALSE) {
|
|
|
ed0026 |
+ return FALSE;
|
|
|
ed0026 |
+ }
|
|
|
ed0026 |
+
|
|
|
ed0026 |
+ if (rsc->fillers) {
|
|
|
ed0026 |
+ GListPtr gIter = NULL;
|
|
|
ed0026 |
+ for (gIter = rsc->fillers; gIter != NULL; gIter = gIter->next) {
|
|
|
ed0026 |
+ resource_t *filler = (resource_t *) gIter->data;
|
|
|
ed0026 |
+
|
|
|
ed0026 |
+ if (filler->is_remote_node) {
|
|
|
ed0026 |
+ return filler;
|
|
|
ed0026 |
+ }
|
|
|
ed0026 |
+ }
|
|
|
ed0026 |
+ }
|
|
|
ed0026 |
+ return NULL;
|
|
|
ed0026 |
+}
|
|
|
ed0026 |
+
|