pacemaker  3.0.0-d8340737c4
Scalable High-Availability cluster resource manager
Macros | Functions | Variables
membership.c File Reference
#include <crm_internal.h>
#include <inttypes.h>
#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include <sys/param.h>
#include <sys/types.h>
#include <unistd.h>
#include <glib.h>
#include <crm/common/ipc.h>
#include <crm/common/xml_internal.h>
#include <crm/cluster/internal.h>
#include <crm/common/xml.h>
#include <crm/stonith-ng.h>
#include "crmcluster_private.h"
#include <crm/cluster/compat.h>
Include dependency graph for membership.c:

Go to the source code of this file.

Macros

#define set_peer_flags(peer, flags_to_set)
 
#define clear_peer_flags(peer, flags_to_clear)
 

Functions

bool pcmk__cluster_has_quorum (void)
 
void pcmk__cluster_set_quorum (bool quorate)
 
unsigned int pcmk__cluster_num_remote_nodes (void)
 
pcmk__node_status_tpcmk__cluster_lookup_remote_node (const char *node_name)
 
void pcmk__cluster_forget_remote_node (const char *node_name)
 
bool pcmk__cluster_is_node_active (const pcmk__node_status_t *node)
 
void pcmk__cluster_forget_cluster_node (uint32_t id, const char *node_name)
 
unsigned int pcmk__cluster_num_active_nodes (void)
 
void pcmk__cluster_init_node_caches (void)
 
void pcmk__cluster_destroy_node_caches (void)
 
void pcmk__cluster_set_status_callback (void(*dispatch)(enum pcmk__node_update, pcmk__node_status_t *, const void *))
 
void pcmk__cluster_set_autoreap (bool enable)
 
pcmk__node_status_tpcmk__search_node_caches (unsigned int id, const char *uname, uint32_t flags)
 
void pcmk__purge_node_from_cache (const char *node_name, uint32_t node_id)
 
pcmk__node_status_tpcmk__get_node (unsigned int id, const char *uname, const char *xml_id, uint32_t flags)
 
pcmk__node_status_tcrm_update_peer_proc (const char *source, pcmk__node_status_t *node, uint32_t flag, const char *status)
 
void pcmk__update_peer_expected (const char *source, pcmk__node_status_t *node, const char *expected)
 
pcmk__node_status_tpcmk__update_peer_state (const char *source, pcmk__node_status_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)
 
void crm_peer_init (void)
 

Variables

GHashTable * pcmk__peer_cache = NULL
 
GHashTable * pcmk__remote_peer_cache = NULL
 

Macro Definition Documentation

◆ clear_peer_flags

#define clear_peer_flags (   peer,
  flags_to_clear 
)
Value:
do { \
(peer)->flags = pcmk__clear_flags_as(__func__, __LINE__, \
"Peer", (peer)->name, \
(peer)->flags, (flags_to_clear), \
#flags_to_clear); \
} while (0)
#define LOG_TRACE
Definition: logging.h:38
uint64_t flags
Definition: remote.c:211

Definition at line 77 of file membership.c.

◆ set_peer_flags

#define set_peer_flags (   peer,
  flags_to_set 
)
Value:
do { \
(peer)->flags = pcmk__set_flags_as(__func__, __LINE__, LOG_TRACE, \
"Peer", (peer)->name, \
(peer)->flags, (flags_to_set), \
#flags_to_set); \
} while (0)
#define LOG_TRACE
Definition: logging.h:38
uint64_t flags
Definition: remote.c:211

Definition at line 70 of file membership.c.

Function Documentation

◆ crm_peer_init()

void crm_peer_init ( void  )
Deprecated:
Do not use

Definition at line 1492 of file membership.c.

◆ crm_update_peer_proc()

pcmk__node_status_t* crm_update_peer_proc ( const char *  source,
pcmk__node_status_t node,
uint32_t  flag,
const char *  status 
)

Definition at line 1095 of file membership.c.

◆ pcmk__cluster_destroy_node_caches()

void pcmk__cluster_destroy_node_caches ( void  )

Definition at line 582 of file membership.c.

◆ pcmk__cluster_forget_cluster_node()

void pcmk__cluster_forget_cluster_node ( uint32_t  id,
const char *  node_name 
)

Definition at line 465 of file membership.c.

◆ pcmk__cluster_forget_remote_node()

void pcmk__cluster_forget_remote_node ( const char *  node_name)

Definition at line 218 of file membership.c.

◆ pcmk__cluster_has_quorum()

bool pcmk__cluster_has_quorum ( void  )

Definition at line 96 of file membership.c.

◆ pcmk__cluster_init_node_caches()

void pcmk__cluster_init_node_caches ( void  )

Definition at line 562 of file membership.c.

◆ pcmk__cluster_is_node_active()

bool pcmk__cluster_is_node_active ( const pcmk__node_status_t node)

Definition at line 368 of file membership.c.

◆ pcmk__cluster_lookup_remote_node()

pcmk__node_status_t* pcmk__cluster_lookup_remote_node ( const char *  node_name)

Definition at line 144 of file membership.c.

◆ pcmk__cluster_num_active_nodes()

unsigned int pcmk__cluster_num_active_nodes ( void  )

Definition at line 530 of file membership.c.

◆ pcmk__cluster_num_remote_nodes()

unsigned int pcmk__cluster_num_remote_nodes ( void  )

Definition at line 120 of file membership.c.

◆ pcmk__cluster_set_autoreap()

void pcmk__cluster_set_autoreap ( bool  enable)

Definition at line 643 of file membership.c.

◆ pcmk__cluster_set_quorum()

void pcmk__cluster_set_quorum ( bool  quorate)

Definition at line 108 of file membership.c.

◆ pcmk__cluster_set_status_callback()

void pcmk__cluster_set_status_callback ( void(*)(enum pcmk__node_update, pcmk__node_status_t *, const void *)  dispatch)

Definition at line 620 of file membership.c.

◆ pcmk__get_node()

pcmk__node_status_t* pcmk__get_node ( unsigned int  id,
const char *  uname,
const char *  xml_id,
uint32_t  flags 
)

Definition at line 927 of file membership.c.

◆ pcmk__purge_node_from_cache()

void pcmk__purge_node_from_cache ( const char *  node_name,
uint32_t  node_id 
)

Definition at line 844 of file membership.c.

◆ pcmk__reap_unseen_nodes()

void pcmk__reap_unseen_nodes ( uint64_t  membership)

Definition at line 1334 of file membership.c.

◆ pcmk__refresh_node_caches_from_cib()

void pcmk__refresh_node_caches_from_cib ( xmlNode *  cib)

Definition at line 1480 of file membership.c.

◆ pcmk__search_node_caches()

pcmk__node_status_t* pcmk__search_node_caches ( unsigned int  id,
const char *  uname,
uint32_t  flags 
)

Definition at line 801 of file membership.c.

◆ pcmk__update_peer_expected()

void pcmk__update_peer_expected ( const char *  source,
pcmk__node_status_t node,
const char *  expected 
)

Definition at line 1192 of file membership.c.

◆ pcmk__update_peer_state()

pcmk__node_status_t* pcmk__update_peer_state ( const char *  source,
pcmk__node_status_t node,
const char *  state,
uint64_t  membership 
)

Update a node's state and membership information.

Parameters
[in]sourceCaller's function name (for log messages)
[in,out]nodeNode object to update
[in]stateNode's new state
[in]membershipNode's new membership ID
Returns
NULL if any node was reaped, value of node otherwise
Note
If this function returns NULL, the supplied node object was likely freed and should not be used again. This function should not be called within a cache iteration if reaping is possible, otherwise reaping could invalidate the iterator.

Definition at line 1321 of file membership.c.

Variable Documentation

◆ pcmk__peer_cache

GHashTable* pcmk__peer_cache = NULL

Definition at line 37 of file membership.c.

◆ pcmk__remote_peer_cache

GHashTable* pcmk__remote_peer_cache = NULL

Definition at line 55 of file membership.c.