|
|
ed0026 |
commit d9b95435059189843e1fb7b1f7530fc163fdfc13
|
|
|
ed0026 |
Author: David Vossel <dvossel@redhat.com>
|
|
|
ed0026 |
Date: Wed Sep 25 17:02:50 2013 -0400
|
|
|
ed0026 |
|
|
|
ed0026 |
properly set remote node attributes
|
|
|
ed0026 |
|
|
|
ed0026 |
diff --git a/crmd/lrm.c b/crmd/lrm.c
|
|
|
ed0026 |
index 0254a9f..7157e24 100644
|
|
|
ed0026 |
--- a/crmd/lrm.c
|
|
|
ed0026 |
+++ b/crmd/lrm.c
|
|
|
ed0026 |
@@ -367,7 +367,7 @@ lrm_state_verify_stopped(lrm_state_t * lrm_state, enum crmd_fsa_state cur_state,
|
|
|
ed0026 |
}
|
|
|
ed0026 |
|
|
|
ed0026 |
if (counter > 0) {
|
|
|
ed0026 |
- do_crm_log(log_level, "%d pending LRM operations at %s%s", counter, when);
|
|
|
ed0026 |
+ do_crm_log(log_level, "%d pending LRM operations at %s", counter, when);
|
|
|
ed0026 |
|
|
|
ed0026 |
if (cur_state == S_TERMINATE || !is_set(fsa_input_register, R_SENT_RSC_STOP)) {
|
|
|
ed0026 |
g_hash_table_iter_init(&gIter, lrm_state->pending_ops);
|
|
|
ed0026 |
diff --git a/crmd/membership.c b/crmd/membership.c
|
|
|
ed0026 |
index 370d1a2..e2bcd45 100644
|
|
|
ed0026 |
--- a/crmd/membership.c
|
|
|
ed0026 |
+++ b/crmd/membership.c
|
|
|
ed0026 |
@@ -260,6 +260,13 @@ populate_cib_nodes(enum node_update_flags flags, const char *source)
|
|
|
ed0026 |
do_update_node_cib(node, flags, node_list, source);
|
|
|
ed0026 |
}
|
|
|
ed0026 |
|
|
|
ed0026 |
+ if (crm_remote_peer_cache) {
|
|
|
ed0026 |
+ g_hash_table_iter_init(&iter, crm_remote_peer_cache);
|
|
|
ed0026 |
+ while (g_hash_table_iter_next(&iter, NULL, (gpointer *) &node)) {
|
|
|
ed0026 |
+ do_update_node_cib(node, flags, node_list, source);
|
|
|
ed0026 |
+ }
|
|
|
ed0026 |
+ }
|
|
|
ed0026 |
+
|
|
|
ed0026 |
fsa_cib_update(XML_CIB_TAG_STATUS, node_list, call_options, call_id, NULL);
|
|
|
ed0026 |
fsa_register_cib_callback(call_id, FALSE, NULL, crmd_node_update_complete);
|
|
|
ed0026 |
last_peer_update = call_id;
|
|
|
ed0026 |
diff --git a/crmd/messages.c b/crmd/messages.c
|
|
|
ed0026 |
index 9aa69cc..057383a 100644
|
|
|
ed0026 |
--- a/crmd/messages.c
|
|
|
ed0026 |
+++ b/crmd/messages.c
|
|
|
ed0026 |
@@ -930,7 +930,7 @@ send_msg_via_ipc(xmlNode * msg, const char *sys)
|
|
|
ed0026 |
crmd_proxy_send(sys, msg);
|
|
|
ed0026 |
|
|
|
ed0026 |
} else {
|
|
|
ed0026 |
- crm_err("Unknown Sub-system (%s)... discarding message.", crm_str(sys));
|
|
|
ed0026 |
+ crm_debug("Unknown Sub-system (%s)... discarding message.", crm_str(sys));
|
|
|
ed0026 |
send_ok = FALSE;
|
|
|
ed0026 |
}
|
|
|
ed0026 |
|
|
|
ed0026 |
diff --git a/crmd/pengine.c b/crmd/pengine.c
|
|
|
ed0026 |
index 5546d7e..2f3eba8 100644
|
|
|
ed0026 |
--- a/crmd/pengine.c
|
|
|
ed0026 |
+++ b/crmd/pengine.c
|
|
|
ed0026 |
@@ -271,6 +271,9 @@ do_pe_invoke_callback(xmlNode * msg, int call_id, int rc, xmlNode * output, void
|
|
|
ed0026 |
|
|
|
ed0026 |
CRM_LOG_ASSERT(output != NULL);
|
|
|
ed0026 |
|
|
|
ed0026 |
+ /* refresh our remote-node cache when the pengine is invoked */
|
|
|
ed0026 |
+ crm_remote_peer_cache_refresh(output);
|
|
|
ed0026 |
+
|
|
|
ed0026 |
crm_xml_add(output, XML_ATTR_DC_UUID, fsa_our_uuid);
|
|
|
ed0026 |
crm_xml_add_int(output, XML_ATTR_HAVE_QUORUM, fsa_has_quorum);
|
|
|
ed0026 |
|
|
|
ed0026 |
diff --git a/crmd/remote_lrmd_ra.c b/crmd/remote_lrmd_ra.c
|
|
|
ed0026 |
index d38d7f0..42ea043 100644
|
|
|
ed0026 |
--- a/crmd/remote_lrmd_ra.c
|
|
|
ed0026 |
+++ b/crmd/remote_lrmd_ra.c
|
|
|
ed0026 |
@@ -333,7 +333,10 @@ remote_lrm_op_callback(lrmd_event_data_t * op)
|
|
|
ed0026 |
|
|
|
ed0026 |
} else {
|
|
|
ed0026 |
/* make sure we have a clean status section to start with */
|
|
|
ed0026 |
+ lrm_state_reset_tables(lrm_state);
|
|
|
ed0026 |
remote_init_cib_status(lrm_state);
|
|
|
ed0026 |
+ erase_status_tag(lrm_state->node_name, XML_CIB_TAG_LRM, cib_scope_local);
|
|
|
ed0026 |
+ erase_status_tag(lrm_state->node_name, XML_TAG_TRANSIENT_NODEATTRS, cib_scope_local);
|
|
|
ed0026 |
|
|
|
ed0026 |
cmd->rc = PCMK_EXECRA_OK;
|
|
|
ed0026 |
cmd->op_status = PCMK_LRM_OP_DONE;
|
|
|
ed0026 |
@@ -430,15 +433,6 @@ handle_remote_ra_exec(gpointer user_data)
|
|
|
ed0026 |
g_list_free_1(first);
|
|
|
ed0026 |
|
|
|
ed0026 |
if (!strcmp(cmd->action, "start") || !strcmp(cmd->action, "migrate_from")) {
|
|
|
ed0026 |
- xmlNode *status = create_xml_node(NULL, XML_CIB_TAG_STATE);
|
|
|
ed0026 |
-
|
|
|
ed0026 |
- /* clear node status in cib */
|
|
|
ed0026 |
- crm_xml_add(status, XML_ATTR_ID, lrm_state->node_name);
|
|
|
ed0026 |
- lrm_state_reset_tables(lrm_state);
|
|
|
ed0026 |
- fsa_cib_delete(XML_CIB_TAG_STATUS, status, cib_quorum_override, rc, NULL);
|
|
|
ed0026 |
- crm_info("Forced a remote LRM refresh before connection start: call=%d", rc);
|
|
|
ed0026 |
- crm_log_xml_trace(status, "CLEAR LRM");
|
|
|
ed0026 |
- free_xml(status);
|
|
|
ed0026 |
|
|
|
ed0026 |
rc = handle_remote_ra_start(lrm_state, cmd, cmd->timeout);
|
|
|
ed0026 |
if (rc == 0) {
|
|
|
ed0026 |
diff --git a/crmd/te_utils.c b/crmd/te_utils.c
|
|
|
ed0026 |
index 54fae04..239af63 100644
|
|
|
ed0026 |
--- a/crmd/te_utils.c
|
|
|
ed0026 |
+++ b/crmd/te_utils.c
|
|
|
ed0026 |
@@ -390,16 +390,7 @@ abort_transition_graph(int abort_priority, enum transition_action abort_action,
|
|
|
ed0026 |
if (safe_str_eq(XML_CIB_TAG_STATE, kind)
|
|
|
ed0026 |
|| safe_str_eq(XML_CIB_TAG_NODE, kind)) {
|
|
|
ed0026 |
|
|
|
ed0026 |
- if (crm_is_true(crm_element_value(search, XML_NODE_IS_REMOTE))) {
|
|
|
ed0026 |
- /* Remote node uname and uuids are the same.
|
|
|
ed0026 |
- * We also don't want them to be present in the
|
|
|
ed0026 |
- * peer cache, so we shouldn't look them up with
|
|
|
ed0026 |
- * crm_peer_uname()
|
|
|
ed0026 |
- */
|
|
|
ed0026 |
- uname = ID(search);
|
|
|
ed0026 |
- } else {
|
|
|
ed0026 |
- uname = crm_peer_uname(ID(search));
|
|
|
ed0026 |
- }
|
|
|
ed0026 |
+ uname = crm_peer_uname(ID(search));
|
|
|
ed0026 |
break;
|
|
|
ed0026 |
}
|
|
|
ed0026 |
search = search->parent;
|
|
|
ed0026 |
diff --git a/include/crm/cluster.h b/include/crm/cluster.h
|
|
|
ed0026 |
index 54b7f58..960c3d0 100644
|
|
|
ed0026 |
--- a/include/crm/cluster.h
|
|
|
ed0026 |
+++ b/include/crm/cluster.h
|
|
|
ed0026 |
@@ -32,6 +32,7 @@
|
|
|
ed0026 |
|
|
|
ed0026 |
extern gboolean crm_have_quorum;
|
|
|
ed0026 |
extern GHashTable *crm_peer_cache;
|
|
|
ed0026 |
+extern GHashTable *crm_remote_peer_cache;
|
|
|
ed0026 |
extern unsigned long long crm_peer_seq;
|
|
|
ed0026 |
|
|
|
ed0026 |
# ifndef CRM_SERVICE
|
|
|
ed0026 |
@@ -55,12 +56,16 @@ enum crm_join_phase
|
|
|
ed0026 |
};
|
|
|
ed0026 |
|
|
|
ed0026 |
/* *INDENT-ON* */
|
|
|
ed0026 |
+enum crm_node_flags
|
|
|
ed0026 |
+{
|
|
|
ed0026 |
+ crm_remote_node = 0x0001,
|
|
|
ed0026 |
+};
|
|
|
ed0026 |
|
|
|
ed0026 |
typedef struct crm_peer_node_s {
|
|
|
ed0026 |
uint32_t id; /* Only used by corosync derivatives */
|
|
|
ed0026 |
uint64_t born; /* Only used by heartbeat and the legacy plugin */
|
|
|
ed0026 |
uint64_t last_seen;
|
|
|
ed0026 |
- uint64_t flags; /* Unused, but might be a good place to specify 'remote' */
|
|
|
ed0026 |
+ uint64_t flags; /* Specified by crm_node_flags enum */
|
|
|
ed0026 |
|
|
|
ed0026 |
int32_t votes; /* Only used by the legacy plugin */
|
|
|
ed0026 |
uint32_t processes;
|
|
|
ed0026 |
@@ -124,11 +129,25 @@ enum crm_ais_msg_types {
|
|
|
ed0026 |
crm_msg_pe = 8,
|
|
|
ed0026 |
crm_msg_stonith_ng = 9,
|
|
|
ed0026 |
};
|
|
|
ed0026 |
+
|
|
|
ed0026 |
+/* used with crm_get_peer_full */
|
|
|
ed0026 |
+enum crm_get_peer_flags {
|
|
|
ed0026 |
+ CRM_GET_PEER_CLUSTER = 0x0001,
|
|
|
ed0026 |
+ CRM_GET_PEER_REMOTE = 0x0002,
|
|
|
ed0026 |
+};
|
|
|
ed0026 |
/* *INDENT-ON* */
|
|
|
ed0026 |
|
|
|
ed0026 |
gboolean send_cluster_message(crm_node_t * node, enum crm_ais_msg_types service,
|
|
|
ed0026 |
xmlNode * data, gboolean ordered);
|
|
|
ed0026 |
|
|
|
ed0026 |
+
|
|
|
ed0026 |
+/* Initialize and refresh the remote peer cache from a cib config */
|
|
|
ed0026 |
+void crm_remote_peer_cache_refresh(xmlNode *cib);
|
|
|
ed0026 |
+
|
|
|
ed0026 |
+/* allows filtering of remote and cluster nodes using crm_get_peer_flags */
|
|
|
ed0026 |
+crm_node_t *crm_get_peer_full(unsigned int id, const char *uname, int flags);
|
|
|
ed0026 |
+
|
|
|
ed0026 |
+/* only searches cluster nodes */
|
|
|
ed0026 |
crm_node_t *crm_get_peer(unsigned int id, const char *uname);
|
|
|
ed0026 |
|
|
|
ed0026 |
guint crm_active_peers(void);
|
|
|
ed0026 |
diff --git a/lib/cib/cib_attrs.c b/lib/cib/cib_attrs.c
|
|
|
ed0026 |
index 4af077c..d1e1b74 100644
|
|
|
ed0026 |
--- a/lib/cib/cib_attrs.c
|
|
|
ed0026 |
+++ b/lib/cib/cib_attrs.c
|
|
|
ed0026 |
@@ -430,6 +430,8 @@ get_remote_node_uuid(cib_t * the_cib, const char *uname, char **uuid)
|
|
|
ed0026 |
cib_sync_call | cib_scope_local | cib_xpath, NULL);
|
|
|
ed0026 |
free(xpath_string);
|
|
|
ed0026 |
free(xml_search);
|
|
|
ed0026 |
+ xml_search = NULL;
|
|
|
ed0026 |
+ xpath_string = NULL;
|
|
|
ed0026 |
|
|
|
ed0026 |
if (rc != pcmk_ok) {
|
|
|
ed0026 |
len = strlen(REMOTE_NODE_XPATH2) + strlen(uname) + 1;
|
|
|
ed0026 |
diff --git a/lib/cluster/cluster.c b/lib/cluster/cluster.c
|
|
|
ed0026 |
index 5820c8d..5b743f9 100644
|
|
|
ed0026 |
--- a/lib/cluster/cluster.c
|
|
|
ed0026 |
+++ b/lib/cluster/cluster.c
|
|
|
ed0026 |
@@ -361,6 +361,11 @@ crm_peer_uname(const char *uuid)
|
|
|
ed0026 |
|
|
|
ed0026 |
CRM_CHECK(uuid != NULL, return NULL);
|
|
|
ed0026 |
|
|
|
ed0026 |
+ /* remote nodes have the same uname and uuid */
|
|
|
ed0026 |
+ if (g_hash_table_lookup(crm_remote_peer_cache, uuid)) {
|
|
|
ed0026 |
+ return uuid;
|
|
|
ed0026 |
+ }
|
|
|
ed0026 |
+
|
|
|
ed0026 |
/* avoid blocking calls where possible */
|
|
|
ed0026 |
g_hash_table_iter_init(&iter, crm_peer_cache);
|
|
|
ed0026 |
while (g_hash_table_iter_next(&iter, NULL, (gpointer *) &node)) {
|
|
|
ed0026 |
diff --git a/lib/cluster/membership.c b/lib/cluster/membership.c
|
|
|
ed0026 |
index bc1684e..e3082b4 100644
|
|
|
ed0026 |
--- a/lib/cluster/membership.c
|
|
|
ed0026 |
+++ b/lib/cluster/membership.c
|
|
|
ed0026 |
@@ -33,9 +33,56 @@
|
|
|
ed0026 |
#include <crm/stonith-ng.h>
|
|
|
ed0026 |
|
|
|
ed0026 |
GHashTable *crm_peer_cache = NULL;
|
|
|
ed0026 |
+GHashTable *crm_remote_peer_cache = NULL;
|
|
|
ed0026 |
unsigned long long crm_peer_seq = 0;
|
|
|
ed0026 |
gboolean crm_have_quorum = FALSE;
|
|
|
ed0026 |
|
|
|
ed0026 |
+static void
|
|
|
ed0026 |
+remote_cache_refresh_helper(xmlNode *cib, const char *xpath, const char *field, int flags)
|
|
|
ed0026 |
+{
|
|
|
ed0026 |
+ const char *remote = NULL;
|
|
|
ed0026 |
+ crm_node_t *node = NULL;
|
|
|
ed0026 |
+ xmlXPathObjectPtr xpathObj = NULL;
|
|
|
ed0026 |
+ int max = 0;
|
|
|
ed0026 |
+ int lpc = 0;
|
|
|
ed0026 |
+
|
|
|
ed0026 |
+ xpathObj = xpath_search(cib, xpath);
|
|
|
ed0026 |
+ max = numXpathResults(xpathObj);
|
|
|
ed0026 |
+ for (lpc = 0; lpc < max; lpc++) {
|
|
|
ed0026 |
+ xmlNode *xml = getXpathResult(xpathObj, lpc);
|
|
|
ed0026 |
+
|
|
|
ed0026 |
+ CRM_CHECK(xml != NULL, continue);
|
|
|
ed0026 |
+
|
|
|
ed0026 |
+ remote = crm_element_value(xml, field);
|
|
|
ed0026 |
+ if (remote) {
|
|
|
ed0026 |
+ crm_trace("added %s to remote cache", remote);
|
|
|
ed0026 |
+ node = calloc(1, sizeof(crm_node_t));
|
|
|
ed0026 |
+ node->flags = flags;
|
|
|
ed0026 |
+ CRM_ASSERT(node);
|
|
|
ed0026 |
+ node->uname = strdup(remote);
|
|
|
ed0026 |
+ node->uuid = strdup(remote);
|
|
|
ed0026 |
+ node->state = strdup(CRM_NODE_MEMBER);
|
|
|
ed0026 |
+ g_hash_table_replace(crm_remote_peer_cache, node->uname, node);
|
|
|
ed0026 |
+ }
|
|
|
ed0026 |
+ }
|
|
|
ed0026 |
+ freeXpathObject(xpathObj);
|
|
|
ed0026 |
+}
|
|
|
ed0026 |
+
|
|
|
ed0026 |
+void crm_remote_peer_cache_refresh(xmlNode *cib)
|
|
|
ed0026 |
+{
|
|
|
ed0026 |
+ const char *xpath = NULL;
|
|
|
ed0026 |
+
|
|
|
ed0026 |
+ g_hash_table_remove_all(crm_remote_peer_cache);
|
|
|
ed0026 |
+
|
|
|
ed0026 |
+ /* remote nodes associated with a cluster resource */
|
|
|
ed0026 |
+ xpath = "//" XML_TAG_CIB "//" XML_CIB_TAG_CONFIGURATION "//" XML_CIB_TAG_RESOURCE "//" XML_TAG_META_SETS "//" XML_CIB_TAG_NVPAIR "[@name='remote-node']";
|
|
|
ed0026 |
+ remote_cache_refresh_helper(cib, xpath, "value", crm_remote_node);
|
|
|
ed0026 |
+
|
|
|
ed0026 |
+ /* remote nodes seen in the status section */
|
|
|
ed0026 |
+ xpath = "//" XML_TAG_CIB "//" XML_CIB_TAG_STATUS "//" XML_CIB_TAG_STATE "[@remote_node='true']";
|
|
|
ed0026 |
+ remote_cache_refresh_helper(cib, xpath, "id", crm_remote_node);
|
|
|
ed0026 |
+}
|
|
|
ed0026 |
+
|
|
|
ed0026 |
gboolean
|
|
|
ed0026 |
crm_is_peer_active(const crm_node_t * node)
|
|
|
ed0026 |
{
|
|
|
ed0026 |
@@ -146,6 +193,10 @@ crm_peer_init(void)
|
|
|
ed0026 |
if (crm_peer_cache == NULL) {
|
|
|
ed0026 |
crm_peer_cache = g_hash_table_new_full(crm_str_hash, g_str_equal, free, destroy_crm_node);
|
|
|
ed0026 |
}
|
|
|
ed0026 |
+
|
|
|
ed0026 |
+ if (crm_remote_peer_cache == NULL) {
|
|
|
ed0026 |
+ crm_remote_peer_cache = g_hash_table_new_full(crm_str_hash, g_str_equal, NULL, destroy_crm_node);
|
|
|
ed0026 |
+ }
|
|
|
ed0026 |
}
|
|
|
ed0026 |
|
|
|
ed0026 |
void
|
|
|
ed0026 |
@@ -156,6 +207,12 @@ crm_peer_destroy(void)
|
|
|
ed0026 |
g_hash_table_destroy(crm_peer_cache);
|
|
|
ed0026 |
crm_peer_cache = NULL;
|
|
|
ed0026 |
}
|
|
|
ed0026 |
+
|
|
|
ed0026 |
+ if (crm_remote_peer_cache != NULL) {
|
|
|
ed0026 |
+ crm_trace("Destroying remote peer cache with %d members", g_hash_table_size(crm_remote_peer_cache));
|
|
|
ed0026 |
+ g_hash_table_destroy(crm_remote_peer_cache);
|
|
|
ed0026 |
+ crm_remote_peer_cache = NULL;
|
|
|
ed0026 |
+ }
|
|
|
ed0026 |
}
|
|
|
ed0026 |
|
|
|
ed0026 |
void (*crm_status_callback) (enum crm_status_type, crm_node_t *, const void *) = NULL;
|
|
|
ed0026 |
@@ -186,6 +243,25 @@ static gboolean crm_hash_find_by_data(gpointer key, gpointer value, gpointer use
|
|
|
ed0026 |
return FALSE;
|
|
|
ed0026 |
}
|
|
|
ed0026 |
|
|
|
ed0026 |
+crm_node_t *
|
|
|
ed0026 |
+crm_get_peer_full(unsigned int id, const char *uname, int flags)
|
|
|
ed0026 |
+{
|
|
|
ed0026 |
+ crm_node_t *node = NULL;
|
|
|
ed0026 |
+
|
|
|
ed0026 |
+ CRM_ASSERT(id > 0 || uname != NULL);
|
|
|
ed0026 |
+
|
|
|
ed0026 |
+ crm_peer_init();
|
|
|
ed0026 |
+
|
|
|
ed0026 |
+ if (flags & CRM_GET_PEER_REMOTE) {
|
|
|
ed0026 |
+ node = g_hash_table_lookup(crm_remote_peer_cache, uname);
|
|
|
ed0026 |
+ }
|
|
|
ed0026 |
+
|
|
|
ed0026 |
+ if (node == NULL && (flags & CRM_GET_PEER_CLUSTER)) {
|
|
|
ed0026 |
+ node = crm_get_peer(id, uname);
|
|
|
ed0026 |
+ }
|
|
|
ed0026 |
+ return node;
|
|
|
ed0026 |
+}
|
|
|
ed0026 |
+
|
|
|
ed0026 |
/* coverity[-alloc] Memory is referenced in one or both hashtables */
|
|
|
ed0026 |
crm_node_t *
|
|
|
ed0026 |
crm_get_peer(unsigned int id, const char *uname)
|
|
|
ed0026 |
diff --git a/lib/lrmd/lrmd_client.c b/lib/lrmd/lrmd_client.c
|
|
|
ed0026 |
index bdaf18c..e577293 100644
|
|
|
ed0026 |
--- a/lib/lrmd/lrmd_client.c
|
|
|
ed0026 |
+++ b/lib/lrmd/lrmd_client.c
|
|
|
ed0026 |
@@ -89,6 +89,11 @@ typedef struct lrmd_private_s {
|
|
|
ed0026 |
gnutls_psk_client_credentials_t psk_cred_c;
|
|
|
ed0026 |
|
|
|
ed0026 |
int sock;
|
|
|
ed0026 |
+ /* since tls requires a round trip across the network for a
|
|
|
ed0026 |
+ * request/reply, there are times where we just want to be able
|
|
|
ed0026 |
+ * to send a request from the client and not wait around (or even care
|
|
|
ed0026 |
+ * about) what the reply is. */
|
|
|
ed0026 |
+ int expected_late_replies;
|
|
|
ed0026 |
GList *pending_notify;
|
|
|
ed0026 |
crm_trigger_t *process_notify;
|
|
|
ed0026 |
#endif
|
|
|
ed0026 |
@@ -241,9 +246,7 @@ lrmd_dispatch_internal(lrmd_t * lrmd, xmlNode * msg)
|
|
|
ed0026 |
/* this is proxy business */
|
|
|
ed0026 |
lrmd_internal_proxy_dispatch(lrmd, msg);
|
|
|
ed0026 |
return 1;
|
|
|
ed0026 |
- }
|
|
|
ed0026 |
-
|
|
|
ed0026 |
- if (!native->callback) {
|
|
|
ed0026 |
+ } else if (!native->callback) {
|
|
|
ed0026 |
/* no callback set */
|
|
|
ed0026 |
crm_trace("notify event received but client has not set callback");
|
|
|
ed0026 |
return 1;
|
|
|
ed0026 |
@@ -371,7 +374,19 @@ lrmd_tls_dispatch(gpointer userdata)
|
|
|
ed0026 |
xml = crm_remote_parse_buffer(native->remote);
|
|
|
ed0026 |
}
|
|
|
ed0026 |
while (xml) {
|
|
|
ed0026 |
- lrmd_dispatch_internal(lrmd, xml);
|
|
|
ed0026 |
+ const char *msg_type = crm_element_value(xml, F_LRMD_REMOTE_MSG_TYPE);
|
|
|
ed0026 |
+ if (safe_str_eq(msg_type, "notify")) {
|
|
|
ed0026 |
+ lrmd_dispatch_internal(lrmd, xml);
|
|
|
ed0026 |
+ } else if (safe_str_eq(msg_type, "reply")) {
|
|
|
ed0026 |
+ if (native->expected_late_replies > 0) {
|
|
|
ed0026 |
+ native->expected_late_replies--;
|
|
|
ed0026 |
+ } else {
|
|
|
ed0026 |
+ int reply_id = 0;
|
|
|
ed0026 |
+ crm_element_value_int(xml, F_LRMD_CALLID, &reply_id);
|
|
|
ed0026 |
+ /* if this happens, we want to know about it */
|
|
|
ed0026 |
+ crm_err("Got outdated reply %d", reply_id);
|
|
|
ed0026 |
+ }
|
|
|
ed0026 |
+ }
|
|
|
ed0026 |
free_xml(xml);
|
|
|
ed0026 |
xml = crm_remote_parse_buffer(native->remote);
|
|
|
ed0026 |
}
|
|
|
ed0026 |
@@ -617,7 +632,11 @@ lrmd_tls_recv_reply(lrmd_t * lrmd, int total_timeout, int expected_reply_id, int
|
|
|
ed0026 |
free_xml(xml);
|
|
|
ed0026 |
xml = NULL;
|
|
|
ed0026 |
} else if (reply_id != expected_reply_id) {
|
|
|
ed0026 |
- crm_err("Got outdated reply, expected id %d got id %d", expected_reply_id, reply_id);
|
|
|
ed0026 |
+ if (native->expected_late_replies > 0) {
|
|
|
ed0026 |
+ native->expected_late_replies--;
|
|
|
ed0026 |
+ } else {
|
|
|
ed0026 |
+ crm_err("Got outdated reply, expected id %d got id %d", expected_reply_id, reply_id);
|
|
|
ed0026 |
+ }
|
|
|
ed0026 |
free_xml(xml);
|
|
|
ed0026 |
xml = NULL;
|
|
|
ed0026 |
}
|
|
|
ed0026 |
@@ -724,6 +743,12 @@ lrmd_send_xml_no_reply(lrmd_t * lrmd, xmlNode * msg)
|
|
|
ed0026 |
#ifdef HAVE_GNUTLS_GNUTLS_H
|
|
|
ed0026 |
case CRM_CLIENT_TLS:
|
|
|
ed0026 |
rc = lrmd_tls_send(lrmd, msg);
|
|
|
ed0026 |
+ if (rc == pcmk_ok) {
|
|
|
ed0026 |
+ /* we don't want to wait around for the reply, but
|
|
|
ed0026 |
+ * since the request/reply protocol needs to behave the same
|
|
|
ed0026 |
+ * as libqb, a reply will eventually come later anyway. */
|
|
|
ed0026 |
+ native->expected_late_replies++;
|
|
|
ed0026 |
+ }
|
|
|
ed0026 |
break;
|
|
|
ed0026 |
#endif
|
|
|
ed0026 |
default:
|
|
|
ed0026 |
diff --git a/lrmd/ipc_proxy.c b/lrmd/ipc_proxy.c
|
|
|
ed0026 |
index bbf9b24..3a51a5b 100644
|
|
|
ed0026 |
--- a/lrmd/ipc_proxy.c
|
|
|
ed0026 |
+++ b/lrmd/ipc_proxy.c
|
|
|
ed0026 |
@@ -313,6 +313,8 @@ ipc_proxy_remove_provider(crm_client_t *ipc_proxy)
|
|
|
ed0026 |
GHashTableIter iter;
|
|
|
ed0026 |
crm_client_t *ipc_client = NULL;
|
|
|
ed0026 |
char *key = NULL;
|
|
|
ed0026 |
+ GList *remove_these = NULL;
|
|
|
ed0026 |
+ GListPtr gIter = NULL;
|
|
|
ed0026 |
|
|
|
ed0026 |
if (ipc_providers == NULL) {
|
|
|
ed0026 |
return;
|
|
|
ed0026 |
@@ -326,9 +328,19 @@ ipc_proxy_remove_provider(crm_client_t *ipc_proxy)
|
|
|
ed0026 |
if (safe_str_eq(proxy_id, ipc_proxy->id)) {
|
|
|
ed0026 |
crm_info("ipc proxy connection for client %s pid %d destroyed because cluster node disconnected.",
|
|
|
ed0026 |
ipc_client->id, ipc_client->pid);
|
|
|
ed0026 |
- qb_ipcs_disconnect(ipc_client->ipcs);
|
|
|
ed0026 |
+ /* we can't remove during the iteration, so copy items
|
|
|
ed0026 |
+ * to a list we can destroy later */
|
|
|
ed0026 |
+ remove_these = g_list_append(remove_these, ipc_client);
|
|
|
ed0026 |
}
|
|
|
ed0026 |
}
|
|
|
ed0026 |
+
|
|
|
ed0026 |
+ for (gIter = remove_these; gIter != NULL; gIter = gIter->next) {
|
|
|
ed0026 |
+ ipc_client = gIter->data;
|
|
|
ed0026 |
+ qb_ipcs_disconnect(ipc_client->ipcs);
|
|
|
ed0026 |
+ }
|
|
|
ed0026 |
+
|
|
|
ed0026 |
+ /* just frees the list, not the elements in the list */
|
|
|
ed0026 |
+ g_list_free(remove_these);
|
|
|
ed0026 |
}
|
|
|
ed0026 |
|
|
|
ed0026 |
void
|
|
|
ed0026 |
diff --git a/lrmd/lrmd.c b/lrmd/lrmd.c
|
|
|
ed0026 |
index a4747cb..b5bbea0 100644
|
|
|
ed0026 |
--- a/lrmd/lrmd.c
|
|
|
ed0026 |
+++ b/lrmd/lrmd.c
|
|
|
ed0026 |
@@ -1297,6 +1297,7 @@ process_lrmd_message(crm_client_t * client, uint32_t id, xmlNode * request)
|
|
|
ed0026 |
do_reply = 1;
|
|
|
ed0026 |
} else if (crm_str_eq(op, LRMD_OP_POKE, TRUE)) {
|
|
|
ed0026 |
do_notify = 1;
|
|
|
ed0026 |
+ do_reply = 1;
|
|
|
ed0026 |
} else {
|
|
|
ed0026 |
rc = -EOPNOTSUPP;
|
|
|
ed0026 |
do_reply = 1;
|
|
|
ed0026 |
diff --git a/pengine/allocate.c b/pengine/allocate.c
|
|
|
ed0026 |
index cf8f4d4..bfa8e7b 100644
|
|
|
ed0026 |
--- a/pengine/allocate.c
|
|
|
ed0026 |
+++ b/pengine/allocate.c
|
|
|
ed0026 |
@@ -1578,6 +1578,8 @@ apply_remote_node_ordering(pe_working_set_t *data_set)
|
|
|
ed0026 |
container = remote_rsc->container;
|
|
|
ed0026 |
if (safe_str_eq(action->task, "monitor") ||
|
|
|
ed0026 |
safe_str_eq(action->task, "start") ||
|
|
|
ed0026 |
+ safe_str_eq(action->task, "promote") ||
|
|
|
ed0026 |
+ safe_str_eq(action->task, "demote") ||
|
|
|
ed0026 |
safe_str_eq(action->task, CRM_OP_LRM_REFRESH) ||
|
|
|
ed0026 |
safe_str_eq(action->task, CRM_OP_CLEAR_FAILCOUNT) ||
|
|
|
ed0026 |
safe_str_eq(action->task, "delete")) {
|