pacemaker 2.1.8-2.1.8
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 <stdint.h> // uint32_t
14#include <crm/common/scheduler_types.h> // pcmk_resource_t, pcmk_action_t
15
132
133/* Action relation object
134 *
135 * The most common type of relation is an ordering, in which case action1 etc.
136 * refers to the "first" action, and action2 etc. refers to the "then" action.
137 */
138typedef struct {
139 int id; // Counter to identify relation
140 uint32_t flags; // Group of enum pcmk__action_relation_flags
141 pcmk_resource_t *rsc1; // Resource for first action, if any
142 pcmk_action_t *action1; // First action in relation
143 char *task1; // Action name or key for first action
144 pcmk_resource_t *rsc2; // Resource for second action, if any
145 pcmk_action_t *action2; // Second action in relation
146 char *task2; // Action name or key for second action
148
150
158#define pcmk__set_relation_flags(ar_flags, flags_to_set) do { \
159 ar_flags = pcmk__set_flags_as(__func__, __LINE__, LOG_TRACE, \
160 "Action relation", "constraint", \
161 ar_flags, (flags_to_set), \
162 #flags_to_set); \
163 } while (0)
164
172#define pcmk__clear_relation_flags(ar_flags, flags_to_clear) do { \
173 ar_flags = pcmk__clear_flags_as(__func__, __LINE__, LOG_TRACE, \
174 "Action relation", "constraint", \
175 ar_flags, (flags_to_clear), \
176 #flags_to_clear); \
177 } while (0)
178
179#endif // PCMK__CRM_COMMON_ACTION_RELATION_INTERNAL__H
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'.
Type aliases needed to define scheduler objects.