36 if (running == NULL) {
56 bool any_created =
false;
58 for (GList *iter = rscs; iter != NULL; iter = iter->next) {
80 if ((rsc1_node != NULL)
82 rsc1_node->
priv->
id) == NULL)) {
120 && (guest_node != NULL)
140 crm_debug(
"Scheduling probe of %s %s on %s",
142 pcmk__node_name(node));
149 add_expected_result(probe, rsc, node);
171 const char *reason = NULL;
177 reason =
"start-up probes are disabled";
181 if (pcmk__is_pacemaker_remote_node(node)) {
183 reason =
"Pacemaker Remote nodes cannot run stonith agents";
186 }
else if (pcmk__is_guest_or_bundle_node(node)
189 reason =
"guest nodes cannot run resources containing guest nodes";
193 reason =
"Pacemaker Remote nodes cannot host remote connections";
205 reason =
"resource is inside a container";
209 reason =
"resource is orphaned";
213 node->
priv->
id) != NULL) {
214 reason =
"resource state is already known";
225 if (allowed == NULL) {
227 reason =
"resource has exclusive discovery but is not allowed "
233 reason =
"resource has exclusive discovery but is not enabled "
239 if (allowed == NULL) {
243 reason =
"node has discovery disabled";
247 if (pcmk__is_guest_or_bundle_node(node)) {
252 reason =
"node's guest is stopped";
253 probe_then_start(guest, top);
256 }
else if (guest_resource_will_stop(node)) {
257 reason =
"node's guest will stop";
270 probe = probe_action(rsc, node);
277 if (!pcmk__is_clone(top)) {
300 "Skipping probe for %s on %s because %s",
320 && pcmk__same_node(probe->
node, then->
node)) {
321 const char *op = g_hash_table_lookup(then->
meta,
331 && (probe->
node != NULL) && (then->
node != NULL)
332 && !pcmk__same_node(probe->
node, then->
node)) {
357 iter != NULL; iter = iter->next) {
361 GList *probes = NULL;
362 GList *then_actions = NULL;
372 if ((order->
rsc1 == NULL) || (order->
rsc1 == order->
rsc2)) {
379 if (((first == NULL) && (order->
task1 == NULL))
380 || ((then == NULL) && (order->
task2 == NULL))) {
388 }
else if ((first == NULL)
398 if ((order->
rsc2 != NULL)
404 }
else if ((then == NULL)
423 order_flags = order->
flags;
429 if (probes == NULL) {
435 then_actions = g_list_prepend(NULL, then);
437 }
else if (order->
rsc2 != NULL) {
440 if (then_actions == NULL) {
446 crm_trace(
"Implying 'probe then' orderings for '%s then %s' "
447 "(id=%d, type=%.6x)",
448 ((first == NULL)? order->
task1 : first->
uuid),
449 ((then == NULL)? order->
task2 : then->
uuid),
452 for (GList *probe_iter = probes; probe_iter != NULL;
453 probe_iter = probe_iter->next) {
457 for (GList *then_iter = then_actions; then_iter != NULL;
458 then_iter = then_iter->next) {
462 if (probe_needed_before_action(probe, then)) {
468 g_list_free(then_actions);
509 crm_trace(
"Adding probe start orderings for 'unrunnable %s@%s "
510 "then instances of %s@%s'",
511 probe->
uuid, pcmk__node_name(probe->
node),
515 then_iter = then_iter->next) {
527 crm_trace(
"Adding probe start ordering for 'unrunnable %s@%s "
528 "then %s@%s' (type=%#.6x)",
529 probe->
uuid, pcmk__node_name(probe->
node),
558 bool interleave =
false;
562 if ((after == NULL) || (probe == NULL) || !pcmk__is_primitive(probe->
rsc)
573 crm_trace(
"Adding probe restart orderings for '%s@%s then %s@%s'",
574 probe->
uuid, pcmk__node_name(probe->
node),
575 after->
uuid, pcmk__node_name(after->
node));
580 if (pcmk__is_primitive(after->
rsc) && (probe->
rsc != after->
rsc)) {
582 GList *then_actions = NULL;
594 for (iter = then_actions; iter != NULL; iter = iter->next) {
602 g_list_free(then_actions);
608 if ((after->
rsc != NULL)
625 for (iter = after->
actions_after; iter != NULL; iter = iter->next) {
646 if ((after->
rsc == NULL)
649 || (after_wrapper->
action->
rsc == NULL)) {
652 chained_rsc = after_wrapper->
action->
rsc;
664 && ((compatible_rsc == NULL)
665 || (compatible_rsc != chained_rsc))) {
670 crm_trace(
"Recursively adding probe restart orderings for "
671 "'%s@%s then %s@%s' (type=%#.6x)",
672 after->
uuid, pcmk__node_name(after->
node),
675 after_wrapper->
flags);
677 add_restart_orderings_for_probe(probe, after_wrapper->
action);
691 iter != NULL; iter = iter->next) {
706add_start_restart_orderings_for_rsc(gpointer
data, gpointer user_data)
709 GList *probes = NULL;
712 if (!pcmk__is_primitive(rsc)) {
714 add_start_restart_orderings_for_rsc, NULL);
722 for (GList *iter = probes; iter != NULL; iter = iter->next) {
725 for (GList *then_iter = probe->
actions_after; then_iter != NULL;
726 then_iter = then_iter->next) {
730 add_start_orderings_for_probe(probe, then);
731 add_restart_orderings_for_probe(probe, then->
action);
781 iter != NULL; iter = iter->next) {
785 GList *actions = NULL;
786 GList *probes = NULL;
791 start = actions->data;
792 g_list_free(actions);
803 actions = actions->next) {
812 clone_actions != NULL;
813 clone_actions = clone_actions->next) {
815 before = clone_actions->data;
830 if (first_rsc == NULL) {
846 for (GList *probe_iter = probes; probe_iter != NULL;
847 probe_iter = probe_iter->next) {
864 add_start_restart_orderings_for_rsc, NULL);
865 add_probe_orderings_for_stops(
scheduler);
882 for (GList *iter =
scheduler->
nodes; iter != NULL; iter = iter->next) {
888 "the connection is unrecoverable", FALSE);
@ pcmk__ar_if_on_same_node
Relation applies only if actions are on same node.
@ pcmk__ar_if_first_unmigratable
Relation applies only if 'first' cannot be part of a live migration.
@ pcmk__ar_first_implies_then
@ pcmk__ar_none
No relation (compare with equality rather than bit set)
@ 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_ordered
Actions are ordered (optionally, if no other flags are set)
@ pcmk__ar_if_on_same_node_or_target
Actions are ordered if on same node (or migration target for migrate_to)
#define pcmk__set_relation_flags(ar_flags, flags_to_set)
#define PCMK_ACTION_PROMOTE
#define PCMK_ACTION_START
#define PCMK_ACTION_MONITOR
#define PCMK_ACTION_STONITH
#define PCMK_ACTION_DEMOTE
#define PCMK_ACTION_DO_SHUTDOWN
@ pcmk__action_detect_loop
#define pcmk__set_action_flags(action, flags_to_set)
char * pcmk__op_key(const char *rsc_id, const char *op_type, guint interval_ms)
Generate an operation key (RESOURCE_ACTION_INTERVAL)
#define pcmk__clear_action_flags(action, flags_to_clear)
#define pcmk_is_set(g, f)
Convenience alias for pcmk_all_flags_set(), to check single flag.
pcmk_resource_t * uber_parent(pcmk_resource_t *rsc)
G_GNUC_INTERNAL void pcmk__new_ordering(pcmk_resource_t *first_rsc, char *first_task, pcmk_action_t *first_action, pcmk_resource_t *then_rsc, char *then_task, pcmk_action_t *then_action, uint32_t flags, pcmk_scheduler_t *sched)
G_GNUC_INTERNAL bool pcmk__is_failed_remote_node(const pcmk_node_t *node)
G_GNUC_INTERNAL pcmk_resource_t * pcmk__find_compatible_instance(const pcmk_resource_t *match_rsc, const pcmk_resource_t *rsc, enum rsc_role_e role, bool current)
G_GNUC_INTERNAL void pcmk__order_vs_unfence(const pcmk_resource_t *rsc, pcmk_node_t *node, pcmk_action_t *action, enum pcmk__action_relation_flags order)
#define crm_debug(fmt, args...)
#define crm_trace(fmt, args...)
pcmk_scheduler_t * scheduler
pcmk_node_t * pcmk__find_node_in_list(const GList *nodes, const char *node_name)
@ pcmk__node_remote_reset
@ pcmk__node_probes_allowed
#define PCMK_META_INTERLEAVE
#define PCMK__META_STONITH_ACTION
bool pcmk__probe_rsc_on_node(pcmk_resource_t *rsc, pcmk_node_t *node)
void pcmk__order_probes(pcmk_scheduler_t *scheduler)
void pcmk__schedule_probes(pcmk_scheduler_t *scheduler)
bool pcmk__probe_resource_list(GList *rscs, pcmk_node_t *node)
GList * pe__resource_actions(const pcmk_resource_t *rsc, const pcmk_node_t *node, const char *task, bool require_node)
Find all actions of given type for a resource.
void pe_fence_node(pcmk_scheduler_t *scheduler, pcmk_node_t *node, const char *reason, bool priority_delay)
Schedule a fence action for a node.
GList * find_actions(GList *input, const char *key, const pcmk_node_t *on_node)
const pcmk_resource_t * pe__const_top_resource(const pcmk_resource_t *rsc, bool include_bundle)
gboolean order_actions(pcmk_action_t *first, pcmk_action_t *then, uint32_t flags)
void pe__add_action_expected_result(pcmk_action_t *action, int expected_result)
pcmk_action_t * custom_action(pcmk_resource_t *rsc, char *key, const char *task, const pcmk_node_t *on_node, gboolean optional, pcmk_scheduler_t *scheduler)
Create or update an action object.
pcmk_resource_t * pe__resource_contains_guest_node(const pcmk_scheduler_t *scheduler, const pcmk_resource_t *rsc)
@ pcmk__rsc_exclusive_probes
@ pcmk__rsc_is_remote_connection
@ pcmk__rsc_variant_group
Group resource.
@ CRM_EX_NOT_RUNNING
Service safely stopped.
@ CRM_EX_PROMOTED
Service active and promoted.
#define pcmk__assert(expr)
const char * pcmk_role_text(enum rsc_role_e role)
Get readable description of a resource role.
@ pcmk_role_unknown
Resource role is unknown.
@ pcmk_role_promoted
Promoted.
@ pcmk_role_stopped
Stopped.
#define pcmk__rsc_trace(rsc, fmt, args...)
@ pcmk__sched_probe_resources
Cluster status and scheduling.
pcmk_node_t * pe_find_node_id(const GList *node_list, const char *id)
Find a node by ID in a list of nodes.
gboolean crm_is_true(const char *s)
bool pcmk__ends_with(const char *s, const char *match)
int required_runnable_before
bool(* create_probe)(pcmk_resource_t *rsc, pcmk_node_t *node)
enum pcmk__probe_mode probe_mode
pcmk_node_t * assigned_node
GHashTable * probed_nodes
pcmk_scheduler_t * scheduler
enum pcmk__rsc_variant variant
enum rsc_role_e orig_role
pcmk_resource_t * launcher
enum rsc_role_e next_role
const pcmk__assignment_methods_t * cmds
GHashTable * allowed_nodes
pcmk__resource_private_t * priv
GList * ordering_constraints
pcmk__scheduler_private_t * priv
pcmk__node_private_t * priv
struct pcmk__node_details * details
struct pcmk__node_assignment * assign