|
pacemaker
2.1.2-ada5c3b36
Scalable High-Availability cluster resource manager
|
#include <crm_internal.h>#include <sys/param.h>#include <sys/types.h>#include <stdio.h>#include <unistd.h>#include <string.h>#include <glib.h>#include <crm/common/ipc.h>#include <crm/common/xml_internal.h>#include <crm/cluster/internal.h>#include <crm/msg_xml.h>#include <crm/stonith-ng.h>#include "crmcluster_private.h"#include <crm/cluster/compat.h>
Go to the source code of this file.
Macros | |
| #define | _GNU_SOURCE |
| #define | set_peer_flags(peer, flags_to_set) |
| #define | clear_peer_flags(peer, flags_to_clear) |
Functions | |
| int | crm_remote_peer_cache_size (void) |
| crm_node_t * | crm_remote_peer_get (const char *node_name) |
| Get a remote node peer cache entry, creating it if necessary. More... | |
| void | crm_remote_peer_cache_remove (const char *node_name) |
| void | crm_remote_peer_cache_refresh (xmlNode *cib) |
| Repopulate the remote peer cache based on CIB XML. More... | |
| gboolean | crm_is_peer_active (const crm_node_t *node) |
| guint | reap_crm_member (uint32_t id, const char *name) |
| Remove all peer cache entries matching a node ID and/or uname. More... | |
| guint | crm_active_peers (void) |
| void | crm_peer_init (void) |
| void | crm_peer_destroy (void) |
| void | crm_set_status_callback (void(*dispatch)(enum crm_status_type, crm_node_t *, const void *)) |
| Set a client function that will be called after peer status changes. More... | |
| void | crm_set_autoreap (gboolean autoreap) |
| Tell the library whether to automatically reap lost nodes. More... | |
| crm_node_t * | pcmk__search_node_caches (unsigned int id, const char *uname, uint32_t flags) |
| crm_node_t * | crm_get_peer_full (unsigned int id, const char *uname, int flags) |
| Get a node cache entry (cluster or Pacemaker Remote) More... | |
| crm_node_t * | pcmk__search_cluster_node_cache (unsigned int id, const char *uname) |
| crm_node_t * | crm_get_peer (unsigned int id, const char *uname) |
| Get a cluster node cache entry. More... | |
| crm_node_t * | crm_update_peer_proc (const char *source, crm_node_t *node, uint32_t flag, const char *status) |
| void | pcmk__update_peer_expected (const char *source, crm_node_t *node, const char *expected) |
| crm_node_t * | pcmk__update_peer_state (const char *source, crm_node_t *node, const char *state, uint64_t membership) |
| Update a node's state and membership information. More... | |
| void | pcmk__reap_unseen_nodes (uint64_t membership) |
| void | pcmk__refresh_node_caches_from_cib (xmlNode *cib) |
| crm_node_t * | pcmk__search_known_node_cache (unsigned int id, const char *uname, uint32_t flags) |
| int | crm_terminate_member (int nodeid, const char *uname, void *unused) |
| int | crm_terminate_member_no_mainloop (int nodeid, const char *uname, int *connection) |
Variables | |
| GHashTable * | crm_peer_cache = NULL |
| GHashTable * | crm_remote_peer_cache = NULL |
| unsigned long long | crm_peer_seq = 0 |
| gboolean | crm_have_quorum = FALSE |
| #define _GNU_SOURCE |
Definition at line 13 of file membership.c.
| #define clear_peer_flags | ( | peer, | |
| flags_to_clear | |||
| ) |
Definition at line 76 of file membership.c.
| #define set_peer_flags | ( | peer, | |
| flags_to_set | |||
| ) |
Definition at line 69 of file membership.c.
| guint crm_active_peers | ( | void | ) |
Definition at line 376 of file membership.c.
| crm_node_t* crm_get_peer | ( | unsigned int | id, |
| const char * | uname | ||
| ) |
Get a cluster node cache entry.
| [in] | id | If not 0, cluster node ID to search for |
| [in] | uname | If not NULL, node name to search for |
Definition at line 702 of file membership.c.
| crm_node_t* crm_get_peer_full | ( | unsigned int | id, |
| const char * | uname, | ||
| int | flags | ||
| ) |
Get a node cache entry (cluster or Pacemaker Remote)
| [in] | id | If not 0, cluster node ID to search for |
| [in] | uname | If not NULL, node name to search for |
| [in] | flags | Bitmask of enum crm_get_peer_flags |
Definition at line 534 of file membership.c.
| gboolean crm_is_peer_active | ( | const crm_node_t * | node | ) |
Definition at line 283 of file membership.c.
| void crm_peer_destroy | ( | void | ) |
Definition at line 417 of file membership.c.
| void crm_peer_init | ( | void | ) |
Definition at line 401 of file membership.c.
| void crm_remote_peer_cache_refresh | ( | xmlNode * | cib | ) |
Repopulate the remote peer cache based on CIB XML.
| [in] | xmlNode | CIB XML to parse |
Definition at line 245 of file membership.c.
| void crm_remote_peer_cache_remove | ( | const char * | node_name | ) |
Definition at line 147 of file membership.c.
| int crm_remote_peer_cache_size | ( | void | ) |
Definition at line 87 of file membership.c.
| crm_node_t* crm_remote_peer_get | ( | const char * | node_name | ) |
Get a remote node peer cache entry, creating it if necessary.
| [in] | node_name | Name of remote node |
Definition at line 107 of file membership.c.
| void crm_set_autoreap | ( | gboolean | autoreap | ) |
Tell the library whether to automatically reap lost nodes.
If TRUE (the default), calling crm_update_peer_proc() will also update the peer state to CRM_NODE_MEMBER or CRM_NODE_LOST, and pcmk__update_peer_state() will reap peers whose state changes to anything other than CRM_NODE_MEMBER. Callers should leave this enabled unless they plan to manage the cache separately on their own.
| [in] | autoreap | TRUE to enable automatic reaping, FALSE to disable |
Definition at line 471 of file membership.c.
| void crm_set_status_callback | ( | void(*)(enum crm_status_type, crm_node_t *, const void *) | dispatch | ) |
Set a client function that will be called after peer status changes.
| [in] | dispatch | Pointer to function to use as callback |
Definition at line 454 of file membership.c.
| int crm_terminate_member | ( | int | nodeid, |
| const char * | uname, | ||
| void * | unused | ||
| ) |
Definition at line 1296 of file membership.c.
| int crm_terminate_member_no_mainloop | ( | int | nodeid, |
| const char * | uname, | ||
| int * | connection | ||
| ) |
Definition at line 1302 of file membership.c.
| crm_node_t* crm_update_peer_proc | ( | const char * | source, |
| crm_node_t * | node, | ||
| uint32_t | flag, | ||
| const char * | status | ||
| ) |
Definition at line 876 of file membership.c.
| void pcmk__reap_unseen_nodes | ( | uint64_t | membership | ) |
Definition at line 1092 of file membership.c.
| void pcmk__refresh_node_caches_from_cib | ( | xmlNode * | cib | ) |
Definition at line 1248 of file membership.c.
| crm_node_t* pcmk__search_cluster_node_cache | ( | unsigned int | id, |
| const char * | uname | ||
| ) |
Definition at line 562 of file membership.c.
| crm_node_t* pcmk__search_known_node_cache | ( | unsigned int | id, |
| const char * | uname, | ||
| uint32_t | flags | ||
| ) |
Definition at line 1265 of file membership.c.
| crm_node_t* pcmk__search_node_caches | ( | unsigned int | id, |
| const char * | uname, | ||
| uint32_t | flags | ||
| ) |
Definition at line 506 of file membership.c.
| void pcmk__update_peer_expected | ( | const char * | source, |
| crm_node_t * | node, | ||
| const char * | expected | ||
| ) |
Definition at line 963 of file membership.c.
| crm_node_t* pcmk__update_peer_state | ( | const char * | source, |
| crm_node_t * | node, | ||
| const char * | state, | ||
| uint64_t | membership | ||
| ) |
Update a node's state and membership information.
| [in] | source | Caller's function name (for log messages) |
| [in] | node | Node object to update |
| [in] | state | Node's new state |
| [in] | membership | Node's new membership ID |
Definition at line 1079 of file membership.c.
| guint reap_crm_member | ( | uint32_t | id, |
| const char * | name | ||
| ) |
Remove all peer cache entries matching a node ID and/or uname.
| [in] | id | ID of node to remove (or 0 to ignore) |
| [in] | name | Uname of node to remove (or NULL to ignore) |
Definition at line 335 of file membership.c.
| gboolean crm_have_quorum = FALSE |
Definition at line 64 of file membership.c.
| GHashTable* crm_peer_cache = NULL |
Definition at line 36 of file membership.c.
| unsigned long long crm_peer_seq = 0 |
Definition at line 63 of file membership.c.
| GHashTable* crm_remote_peer_cache = NULL |
Definition at line 53 of file membership.c.
1.8.14