Skip to content

Commit

Permalink
Merge branch 'master' of github.com:ClusterLabs/pacemaker
Browse files Browse the repository at this point in the history
  • Loading branch information
beekhof committed Mar 26, 2015
2 parents f92f6b9 + c883063 commit 3e93bc1
Show file tree
Hide file tree
Showing 38 changed files with 3,846 additions and 249 deletions.
3 changes: 3 additions & 0 deletions crmd/callbacks.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,9 @@ peer_update_callback(enum crm_status_type type, crm_node_t * node, const void *d
if (alive && safe_str_eq(task, CRM_OP_FENCE)) {
crm_info("Node return implies stonith of %s (action %d) completed", node->uname,
down->id);

st_fail_count_reset(node->uname);

erase_status_tag(node->uname, XML_CIB_TAG_LRM, cib_scope_local);
erase_status_tag(node->uname, XML_TAG_TRANSIENT_NODEATTRS, cib_scope_local);
/* down->confirmed = TRUE; Only stonith-ng returning should imply completion */
Expand Down
77 changes: 1 addition & 76 deletions crmd/lrm_state.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,10 @@
#include <crmd_lrm.h>

GHashTable *lrm_state_table = NULL;
GHashTable *proxy_table = NULL;
extern GHashTable *proxy_table;
int lrmd_internal_proxy_send(lrmd_t * lrmd, xmlNode *msg);
void lrmd_internal_set_proxy_callback(lrmd_t * lrmd, void *userdata, void (*callback)(lrmd_t *lrmd, void *userdata, xmlNode *msg));

typedef struct remote_proxy_s {
char *node_name;
char *session_id;

gboolean is_local;

crm_ipc_t *ipc;
mainloop_io_t *source;
uint32_t last_request_id;

} remote_proxy_t;

static void
history_cache_destroy(gpointer data)
{
Expand Down Expand Up @@ -218,32 +206,6 @@ lrm_state_reset_tables(lrm_state_t * lrm_state)
}
}

static void
remote_proxy_end_session(const char *session)
{
remote_proxy_t *proxy = g_hash_table_lookup(proxy_table, session);

if (proxy == NULL) {
return;
}
crm_trace("ending session ID %s", proxy->session_id);

if (proxy->source) {
mainloop_del_ipc_client(proxy->source);
}
}

static void
remote_proxy_free(gpointer data)
{
remote_proxy_t *proxy = data;

crm_trace("freed proxy session ID %s", proxy->session_id);
free(proxy->node_name);
free(proxy->session_id);
free(proxy);
}

gboolean
lrm_state_init_local(void)
{
Expand Down Expand Up @@ -359,43 +321,6 @@ lrm_state_ipc_connect(lrm_state_t * lrm_state)
return ret;
}

static void
remote_proxy_notify_destroy(lrmd_t *lrmd, const char *session_id)
{
/* sending to the remote node that an ipc connection has been destroyed */
xmlNode *msg = create_xml_node(NULL, T_LRMD_IPC_PROXY);
crm_xml_add(msg, F_LRMD_IPC_OP, "destroy");
crm_xml_add(msg, F_LRMD_IPC_SESSION, session_id);
lrmd_internal_proxy_send(lrmd, msg);
free_xml(msg);
}

static void
remote_proxy_relay_event(lrmd_t *lrmd, const char *session_id, xmlNode *msg)
{
/* sending to the remote node an event msg. */
xmlNode *event = create_xml_node(NULL, T_LRMD_IPC_PROXY);
crm_xml_add(event, F_LRMD_IPC_OP, "event");
crm_xml_add(event, F_LRMD_IPC_SESSION, session_id);
add_message_xml(event, F_LRMD_IPC_MSG, msg);
crm_log_xml_explicit(event, "EventForProxy");
lrmd_internal_proxy_send(lrmd, event);
free_xml(event);
}

static void
remote_proxy_relay_response(lrmd_t *lrmd, const char *session_id, xmlNode *msg, int msg_id)
{
/* sending to the remote node a response msg. */
xmlNode *response = create_xml_node(NULL, T_LRMD_IPC_PROXY);
crm_xml_add(response, F_LRMD_IPC_OP, "response");
crm_xml_add(response, F_LRMD_IPC_SESSION, session_id);
crm_xml_add_int(response, F_LRMD_IPC_MSG_ID, msg_id);
add_message_xml(response, F_LRMD_IPC_MSG, msg);
lrmd_internal_proxy_send(lrmd, response);
free_xml(response);
}

static int
remote_proxy_dispatch_internal(const char *buffer, ssize_t length, gpointer userdata)
{
Expand Down
5 changes: 5 additions & 0 deletions extra/resources/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ include $(top_srcdir)/Makefile.common

EXTRA_DIST = $(ocf_SCRIPTS)


containertechdir = @OCF_RA_DIR@/containers

ocfdir = @OCF_RA_DIR@/pacemaker

ocf_SCRIPTS = ClusterMon \
Expand All @@ -36,6 +39,8 @@ ocf_SCRIPTS = ClusterMon \
SystemHealth \
remote

containertech_SCRIPTS = docker-wrapper

if BUILD_XML_HELP

man7_MANS = $(ocf_SCRIPTS:%=ocf_pacemaker_%.7)
Expand Down
Loading

0 comments on commit 3e93bc1

Please sign in to comment.