pacemaker 3.0.1-16e74fc4da
Scalable High-Availability cluster resource manager
Loading...
Searching...
No Matches
action_relation_internal.h
Go to the documentation of this file.
1/*
2 * Copyright 2023-2024 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__CRM_COMMON_ACTION_RELATION_INTERNAL__H
11#define PCMK__CRM_COMMON_ACTION_RELATION_INTERNAL__H
12
13#include <stdbool.h> // bool
14#include <stdint.h> // uint32_t
15#include <glib.h> // gpointer
16#include <crm/common/scheduler_types.h> // pcmk_resource_t, pcmk_action_t
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
22// Flags to indicate the relationship between two actions
133
134/* Action relation object
135 *
136 * The most common type of relation is an ordering, in which case action1 etc.
137 * refers to the "first" action, and action2 etc. refers to the "then" action.
138 */
139typedef struct {
140 int id; // Counter to identify relation
141 uint32_t flags; // Group of enum pcmk__action_relation_flags
142 pcmk_resource_t *rsc1; // Resource for first action, if any
143 pcmk_action_t *action1; // First action in relation
144 char *task1; // Action name or key for first action
145 pcmk_resource_t *rsc2; // Resource for second action, if any
146 pcmk_action_t *action2; // Second action in relation
147 char *task2; // Action name or key for second action
149
150// Action sequenced relative to another action
151typedef struct pcmk__related_action {
152 pcmk_action_t *action; // Action to be sequenced
153 uint32_t flags; // Group of enum pcmk__action_relation_flags
154 bool graphed; // Whether action has been added to graph yet
156
164#define pcmk__set_relation_flags(ar_flags, flags_to_set) do { \
165 ar_flags = pcmk__set_flags_as(__func__, __LINE__, LOG_TRACE, \
166 "Action relation", "constraint", \
167 ar_flags, (flags_to_set), \
168 #flags_to_set); \
169 } while (0)
170
178#define pcmk__clear_relation_flags(ar_flags, flags_to_clear) do { \
179 ar_flags = pcmk__clear_flags_as(__func__, __LINE__, LOG_TRACE, \
180 "Action relation", "constraint", \
181 ar_flags, (flags_to_clear), \
182 #flags_to_clear); \
183 } while (0)
184
185void pcmk__free_action_relation(gpointer user_data);
186
187#ifdef __cplusplus
188}
189#endif
190
191#endif // PCMK__CRM_COMMON_ACTION_RELATION_INTERNAL__H
void pcmk__free_action_relation(gpointer user_data)
pcmk__action_relation_flags
@ pcmk__ar_if_on_same_node
Relation applies only if actions are on same node.
@ pcmk__ar_first_else_then
If 'first' is unrunnable, 'then' becomes a real, unmigratable action.
@ pcmk__ar_if_first_unmigratable
Relation applies only if 'first' cannot be part of a live migration.
@ pcmk__ar_first_implies_then
@ pcmk__ar_asymmetric
User-configured asymmetric ordering.
@ pcmk__ar_first_implies_same_node_then
If 'first' is required, 'then' action for instance on same node is.
@ pcmk__ar_then_implies_first
@ pcmk__ar_intermediate_stop
@ pcmk__ar_promoted_then_implies_first
@ pcmk__ar_then_implies_first_graphed
If 'then' is required, 'first' must be added to the transition graph.
@ pcmk__ar_min_runnable
'then' action is runnable if certain number of 'first' instances are
@ pcmk__ar_none
No relation (compare with equality rather than bit set)
@ pcmk__ar_first_implies_then_graphed
If 'first' is required and runnable, 'then' must be in graph.
@ pcmk__ar_nested_remote_probe
@ pcmk__ar_if_required_on_same_node
Ordering applies only if 'first' is required and on same node as 'then'.
@ pcmk__ar_unrunnable_first_blocks
'then' is runnable (and migratable) only if 'first' is runnable
@ pcmk__ar_unmigratable_then_blocks
@ pcmk__ar_ordered
Actions are ordered (optionally, if no other flags are set)
@ pcmk__ar_then_cancels_first
If 'then' action becomes required, 'first' becomes optional.
@ pcmk__ar_if_on_same_node_or_target
Actions are ordered if on same node (or migration target for migrate_to)
@ pcmk__ar_guest_allowed
Ordering applies even if 'first' runs on guest node created by 'then'.
struct pcmk__related_action pcmk__related_action_t
Type aliases needed to define scheduler objects.