pacemaker 2.1.7-2.1.7
Scalable High-Availability cluster resource manager
Loading...
Searching...
No Matches
pcmki_transition.h
Go to the documentation of this file.
1/*
2 * Copyright 2004-2023 the Pacemaker project contributors
3 *
4 * The version control history for this file may have further details.
5 *
6 * This source code is licensed under the GNU Lesser General Public License
7 * version 2.1 or later (LGPLv2.1+) WITHOUT ANY WARRANTY.
8 */
9
10#ifndef PCMK__PCMKI_PCMKI_TRANSITION__H
11# define PCMK__PCMKI_PCMKI_TRANSITION__H
12
13# include <glib.h>
14# include <crm/crm.h>
15# include <crm/msg_xml.h>
16# include <crm/common/xml.h>
17# include <crm/lrmd_events.h> // lrmd_event_data_t
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
28
35
36typedef struct {
37 int id;
39
40 uint32_t flags; // Group of pcmk__synapse_flags
41
42 GList *actions; /* pcmk__graph_action_t* */
43 GList *inputs; /* pcmk__graph_action_t* */
45
46#define pcmk__set_synapse_flags(synapse, flags_to_set) do { \
47 (synapse)->flags = pcmk__set_flags_as(__func__, __LINE__, \
48 LOG_TRACE, \
49 "Synapse", "synapse", \
50 (synapse)->flags, (flags_to_set), #flags_to_set); \
51 } while (0)
52
53#define pcmk__clear_synapse_flags(synapse, flags_to_clear) do { \
54 (synapse)->flags = pcmk__clear_flags_as(__func__, __LINE__, \
55 LOG_TRACE, \
56 "Synapse", "synapse", \
57 (synapse)->flags, (flags_to_clear), #flags_to_clear); \
58 } while (0)
59
61 pcmk__graph_action_sent_update = (1 << 0), /* sent to the CIB */
62 pcmk__graph_action_executed = (1 << 1), /* sent to the CRM */
66};
67
68typedef struct {
69 int id;
71 int timer;
73 GHashTable *params;
76
77 uint32_t flags; // Group of pcmk__graph_action_flags
78
79 xmlNode *xml;
80
82
83#define pcmk__set_graph_action_flags(action, flags_to_set) do { \
84 (action)->flags = pcmk__set_flags_as(__func__, __LINE__, \
85 LOG_TRACE, \
86 "Action", "action", \
87 (action)->flags, (flags_to_set), #flags_to_set); \
88 } while (0)
89
90#define pcmk__clear_graph_action_flags(action, flags_to_clear) do { \
91 (action)->flags = pcmk__clear_flags_as(__func__, __LINE__, \
92 LOG_TRACE, \
93 "Action", "action", \
94 (action)->flags, (flags_to_clear), #flags_to_clear); \
95 } while (0)
96
97// What to do after finished processing a transition graph
99 // Order matters: lowest priority to highest
100 pcmk__graph_done, // Transition complete, nothing further needed
101 pcmk__graph_wait, // Transition interrupted, wait for further changes
102 pcmk__graph_restart, // Transition interrupted, start a new one
103 pcmk__graph_shutdown, // Transition interrupted, local shutdown needed
104};
105
106typedef struct {
107 int id;
108 char *source;
110
112 const char *abort_reason;
114
117
121
122 int fired;
127
128 GList *synapses; /* pcmk__graph_synapse_t* */
129
131
134
137
141
142
143typedef struct {
144 int (*pseudo) (pcmk__graph_t *graph, pcmk__graph_action_t *action);
146 int (*cluster) (pcmk__graph_t *graph, pcmk__graph_action_t *action);
148 bool (*allowed) (pcmk__graph_t *graph, pcmk__graph_action_t *action);
150
152 pcmk__graph_active, // Some actions have been performed
153 pcmk__graph_pending, // No actions performed yet
156};
157
159pcmk__graph_t *pcmk__unpack_graph(const xmlNode *xml_graph,
160 const char *reference);
165const char *pcmk__graph_status2text(enum pcmk__graph_status state);
166void pcmk__log_graph(unsigned int log_level, pcmk__graph_t *graph);
168void pcmk__log_transition_summary(const char *filename);
169lrmd_event_data_t *pcmk__event_from_graph_action(const xmlNode *resource,
171 int status, int rc,
172 const char *exit_reason);
173
174#ifdef __cplusplus
175}
176#endif
177
178#endif
A dumping ground.
Resource agent executor events.
const char * action
Definition pcmk_fence.c:30
pcmk__graph_action_flags
@ pcmk__graph_action_confirmed
@ pcmk__graph_action_sent_update
@ pcmk__graph_action_can_fail
@ pcmk__graph_action_failed
@ pcmk__graph_action_executed
pcmk__graph_next
@ pcmk__graph_done
@ pcmk__graph_restart
@ pcmk__graph_shutdown
@ pcmk__graph_wait
void pcmk__free_graph(pcmk__graph_t *graph)
void pcmk__log_graph_action(int log_level, pcmk__graph_action_t *action)
pcmk__graph_t * pcmk__unpack_graph(const xmlNode *xml_graph, const char *reference)
void pcmk__set_graph_functions(pcmk__graph_functions_t *fns)
const char * pcmk__graph_status2text(enum pcmk__graph_status state)
pcmk__synapse_flags
@ pcmk__synapse_ready
@ pcmk__synapse_executed
@ pcmk__synapse_confirmed
@ pcmk__synapse_failed
enum pcmk__graph_status pcmk__execute_graph(pcmk__graph_t *graph)
lrmd_event_data_t * pcmk__event_from_graph_action(const xmlNode *resource, const pcmk__graph_action_t *action, int status, int rc, const char *exit_reason)
pcmk__graph_status
@ pcmk__graph_pending
@ pcmk__graph_terminated
@ pcmk__graph_active
@ pcmk__graph_complete
void pcmk__log_transition_summary(const char *filename)
void pcmk__update_graph(pcmk__graph_t *graph, const pcmk__graph_action_t *action)
void pcmk__log_graph(unsigned int log_level, pcmk__graph_t *graph)
pcmk__graph_action_type
@ pcmk__pseudo_graph_action
@ pcmk__cluster_graph_action
@ pcmk__rsc_graph_action
enum pcmk__graph_action_type type
pcmk__graph_synapse_t * synapse
char * failed_stop_offset
Failcount after one failed stop action.
time_t recheck_by
Time (from epoch) by which the controller should re-run the scheduler.
enum pcmk__graph_next completion_action
char * failed_start_offset
Failcount after one failed start action.
const char * abort_reason
Wrappers for and extensions to libxml2.