46 const char *reason = NULL;
54 reason =
"action definition changed";
61 switch (digest_data->
rc) {
63 crm_trace(
"Resource %s history entry %s on %s has " 64 "no digest to compare",
65 rsc->
id, pcmk__xe_id(rsc_op), node->
priv->
id);
70 reason =
"resource parameters have changed";
91 failcount_clear_action_exists(
const pcmk_node_t *node,
112 check_failure_threshold(gpointer
data, gpointer user_data)
119 g_list_foreach(rsc->
priv->
children, check_failure_threshold,
124 if (!failcount_clear_action_exists(node, rsc)) {
158 apply_exclusive_discovery(gpointer
data, gpointer user_data)
169 g_list_foreach(rsc->
priv->
children, apply_exclusive_discovery,
189 apply_stickiness(gpointer
data, gpointer user_data)
196 g_list_foreach(rsc->
priv->
children, apply_stickiness, NULL);
219 node->
priv->
id) == NULL)) {
221 "Ignoring %s stickiness because the cluster is " 222 "asymmetric and %s is not explicitly allowed",
223 rsc->
id, pcmk__node_name(node));
246 iter != NULL; iter = iter->next) {
265 crm_trace(
"Applying node-specific scheduling criteria");
271 node_iter = node_iter->next) {
274 rsc_iter != NULL; rsc_iter = rsc_iter->next) {
276 check_failure_threshold(rsc_iter->data, node_iter->data);
277 apply_exclusive_discovery(rsc_iter->data, node_iter->data);
293 crm_trace(
"Assigning resources to nodes");
307 iter != NULL; iter = iter->next) {
342 clear_failcounts_if_orphaned(gpointer
data, gpointer user_data)
349 crm_trace(
"Clear fail counts for orphaned resource %s", rsc->
id);
356 iter != NULL; iter = iter->next) {
402 crm_trace(
"Scheduling resource actions");
404 iter != NULL; iter = iter->next) {
427 iter != NULL; iter = iter->next) {
448 iter != NULL; iter = iter->next) {
466 needs_fencing(
const pcmk_node_t *node,
bool have_managed)
483 if (pcmk__is_pacemaker_remote_node(node)) {
515 return g_list_prepend(list,
action);
531 pcmk__node_name(node));
546 bool integrity_lost =
false;
547 bool have_managed = any_managed_resources(
scheduler);
548 GList *fencing_ops = NULL;
549 GList *shutdown_ops = NULL;
551 crm_trace(
"Scheduling fencing and shutdowns as needed");
553 crm_notice(
"No fencing will be done until there are resources " 558 for (GList *iter =
scheduler->
nodes; iter != NULL; iter = iter->next) {
566 if (pcmk__is_guest_or_bundle_node(node)) {
574 if (needs_fencing(node, have_managed)) {
575 fencing = schedule_fencing(node);
581 fencing_ops = add_nondc_fencing(fencing_ops, fencing,
585 }
else if (needs_shutdown(node)) {
592 shutdown_ops = g_list_prepend(shutdown_ops, down_op);
597 integrity_lost =
true;
599 pcmk__node_name(node));
603 if (integrity_lost) {
606 "cannot be guaranteed (configure, enable, " 607 "and test fencing to correct this)");
610 crm_notice(
"Unclean nodes will not be fenced until quorum is " 616 if (dc_down != NULL) {
636 }
else if (fencing_ops != NULL) {
646 g_list_free(fencing_ops);
647 g_list_free(shutdown_ops);
660 all = g_list_prepend(all, (gpointer)
"*");
663 item != NULL; item = item->next) {
718 crm_trace(
"Required but unrunnable actions:");
720 iter != NULL; iter = iter->next) {
742 crm_trace(
"Reusing previously calculated cluster status");
803 schedule_fencing_and_shutdowns(
scheduler);
842 if (new_scheduler == NULL) {
853 if (new_scheduler->
input == NULL) {
854 out->
err(out,
"Failed to copy input XML");
const pcmk_resource_t * pe__const_top_resource(const pcmk_resource_t *rsc, bool include_bundle)
void(* end_list)(pcmk__output_t *out)
bool pe_can_fence(const pcmk_scheduler_t *scheduler, const pcmk_node_t *node)
enum pcmk__probe_mode probe_mode
G_GNUC_INTERNAL void pcmk__order_after_each(pcmk_action_t *after, GList *list)
xmlNode * pcmk__xml_copy(xmlNode *parent, xmlNode *src)
G_GNUC_INTERNAL void pcmk__show_node_capacities(const char *desc, pcmk_scheduler_t *scheduler)
#define crm_notice(fmt, args...)
void(* create_actions)(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)
int cib__signon_query(pcmk__output_t *out, cib_t **cib, xmlNode **cib_object)
int(* message)(pcmk__output_t *out, const char *message_id,...)
pcmk_node_t *(* assign)(pcmk_resource_t *rsc, const pcmk_node_t *prefer, bool stop_if_fail)
struct crm_time_s crm_time_t
#define pcmk__config_warn(fmt...)
G_GNUC_INTERNAL bool pcmk__threshold_reached(pcmk_resource_t *rsc, const pcmk_node_t *node, pcmk_resource_t **failed)
#define pcmk__rsc_trace(rsc, fmt, args...)
pcmk__op_digest_t * rsc_action_digest_cmp(pcmk_resource_t *rsc, const xmlNode *xml_op, pcmk_node_t *node, pcmk_scheduler_t *scheduler)
crm_time_t * pcmk_copy_time(const crm_time_t *source)
G_GNUC_INTERNAL void pcmk__apply_locations(pcmk_scheduler_t *scheduler)
pcmk_action_t * pe_fence_op(pcmk_node_t *node, const char *op, bool optional, const char *reason, bool priority_delay, pcmk_scheduler_t *scheduler)
#define PCMK_VALUE_DEFAULT
pcmk__scheduler_private_t * priv
G_GNUC_INTERNAL void pcmk__handle_rsc_config_changes(pcmk_scheduler_t *scheduler)
#define PCMK_ACTION_DO_SHUTDOWN
pcmk_action_t * pe__clear_failcount(pcmk_resource_t *rsc, const pcmk_node_t *node, const char *reason, pcmk_scheduler_t *scheduler)
Schedule a controller operation to clear a fail count.
#define PCMK_ACTION_CLEAR_FAILCOUNT
G_GNUC_INTERNAL void pcmk__sort_resources(pcmk_scheduler_t *scheduler)
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 pcmk__output_set_log_level(pcmk__output_t *out, uint8_t log_level)
void pe__foreach_param_check(pcmk_scheduler_t *scheduler, void(*cb)(pcmk_resource_t *, pcmk_node_t *, const xmlNode *, enum pcmk__check_parameters))
gboolean cluster_status(pcmk_scheduler_t *scheduler)
G_GNUC_INTERNAL void pcmk__create_graph(pcmk_scheduler_t *scheduler)
int pe_get_failcount(const pcmk_node_t *node, pcmk_resource_t *rsc, time_t *last_failure, uint32_t flags, const xmlNode *xml_op)
#define pcmk__rsc_debug(rsc, fmt, args...)
pcmk__node_private_t * priv
pcmk_scheduler_t * scheduler
Actions are ordered (optionally, if no other flags are set)
void pcmk__unpack_constraints(pcmk_scheduler_t *scheduler)
G_GNUC_INTERNAL void pcmk__log_action(const char *pre_text, const pcmk_action_t *action, bool details)
void resource_location(pcmk_resource_t *rsc, const pcmk_node_t *node, int score, const char *tag, pcmk_scheduler_t *scheduler)
void pe__free_param_checks(pcmk_scheduler_t *scheduler)
#define crm_trace(fmt, args...)
#define pcmk_is_set(g, f)
Convenience alias for pcmk_all_flags_set(), to check single flag.
CRM_TRACE_INIT_DATA(pacemaker)
int(*) int(*) void(* err)(pcmk__output_t *out, const char *format,...) G_GNUC_PRINTF(2
pcmk__resource_private_t * priv
void set_working_set_defaults(pcmk_scheduler_t *scheduler)
void pcmk__register_lib_messages(pcmk__output_t *out)
#define PCMK_VALUE_IGNORE
void(* shutdown_lock)(pcmk_resource_t *rsc)
Wrappers for and extensions to libxml2.
void(* finish)(pcmk__output_t *out, crm_exit_t exit_status, bool print, void **copy_dest)
G_GNUC_INTERNAL void pcmk__output_actions(pcmk_scheduler_t *scheduler)
pcmk_scheduler_t * scheduler
G_GNUC_INTERNAL pcmk_action_t * pcmk__new_shutdown_action(pcmk_node_t *node)
void pe__register_messages(pcmk__output_t *out)
pcmk_scheduler_t * pe_new_working_set(void)
Create a new object to hold scheduler data.
gboolean order_actions(pcmk_action_t *first, pcmk_action_t *then, uint32_t flags)
GHashTable * allowed_nodes
void pcmk__output_free(pcmk__output_t *out)
#define pcmk__assert(expr)
void pe_free_working_set(pcmk_scheduler_t *scheduler)
Free scheduler data.
#define pcmk__sched_warn(scheduler, fmt...)
unsigned int get_crm_log_level(void)
G_GNUC_INTERNAL void pcmk__set_assignment_methods(pcmk_scheduler_t *scheduler)
G_GNUC_INTERNAL void pcmk__apply_node_health(pcmk_scheduler_t *scheduler)
Cluster status and scheduling.
void pcmk__schedule_actions(xmlNode *cib, unsigned long long flags, pcmk_scheduler_t *scheduler)
G_GNUC_INTERNAL void pcmk__order_remote_connection_actions(pcmk_scheduler_t *scheduler)
pcmk_scheduler_t * scheduler
G_GNUC_INTERNAL void pcmk__apply_orderings(pcmk_scheduler_t *sched)
G_GNUC_INTERNAL void pcmk__schedule_probes(pcmk_scheduler_t *scheduler)
enum rsc_role_e orig_role
const char * placement_strategy
This structure contains everything that makes up a single output formatter.
void(* begin_list)(pcmk__output_t *out, const char *singular_noun, const char *plural_noun, const char *format,...) G_GNUC_PRINTF(4
#define PCMK_OPT_NO_QUORUM_POLICY
int pcmk__init_scheduler(pcmk__output_t *out, xmlNodePtr input, const crm_time_t *date, pcmk_scheduler_t **scheduler)
G_GNUC_INTERNAL void pcmk__order_vs_fence(pcmk_action_t *stonith_op, pcmk_scheduler_t *scheduler)
G_GNUC_INTERNAL void pcmk__fence_guest(pcmk_node_t *node)
G_GNUC_INTERNAL bool pcmk__check_action_config(pcmk_resource_t *rsc, pcmk_node_t *node, const xmlNode *xml_op)
struct pcmk__node_details * details
#define pcmk__set_scheduler_flags(scheduler, flags_to_set)
G_GNUC_INTERNAL void pcmk__create_internal_constraints(pcmk_scheduler_t *scheduler)
int pcmk__log_output_new(pcmk__output_t **out)
const pcmk__assignment_methods_t * cmds
enum pcmk__digest_result rc
pcmk_node_t * partial_migration_target
#define PCMK_SCORE_INFINITY
Integer score to use to represent "infinity".
struct pcmk__node_assignment * assign