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",
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->
children, check_failure_threshold, user_data);
123 if (!failcount_clear_action_exists(node, rsc)) {
138 "__fail_limit__", rsc->
cluster);
157 apply_exclusive_discovery(gpointer
data, gpointer user_data)
167 g_list_foreach(rsc->
children, apply_exclusive_discovery, user_data);
185 apply_stickiness(gpointer
data, gpointer user_data)
192 g_list_foreach(rsc->
children, apply_stickiness, NULL);
215 "Ignoring %s stickiness because the cluster is " 216 "asymmetric and %s is not explicitly allowed",
217 rsc->
id, pcmk__node_name(node));
259 for (GList *iter =
scheduler->
nodes; iter != NULL; iter = iter->next) {
281 crm_trace(
"Applying node-specific scheduling criteria");
288 node_iter = node_iter->next) {
290 rsc_iter = rsc_iter->next) {
291 check_failure_threshold(rsc_iter->data, node_iter->data);
292 apply_exclusive_discovery(rsc_iter->data, node_iter->data);
308 crm_trace(
"Assigning resources to nodes");
338 rsc->
xml->name, rsc->
id);
354 clear_failcounts_if_orphaned(gpointer
data, gpointer user_data)
361 crm_trace(
"Clear fail counts for orphaned resource %s", rsc->
id);
367 for (GList *iter = rsc->
cluster->
nodes; iter != NULL; iter = iter->next) {
412 crm_trace(
"Scheduling resource actions");
434 for (GList *iter = rsc->
children; iter != NULL; iter = iter->next) {
454 iter != NULL; iter = iter->next) {
472 needs_fencing(
const pcmk_node_t *node,
bool have_managed)
489 if (pcmk__is_pacemaker_remote_node(node)) {
521 return g_list_prepend(list,
action);
551 bool integrity_lost =
false;
552 bool have_managed = any_managed_resources(
scheduler);
553 GList *fencing_ops = NULL;
554 GList *shutdown_ops = NULL;
556 crm_trace(
"Scheduling fencing and shutdowns as needed");
558 crm_notice(
"No fencing will be done until there are resources " 563 for (GList *iter =
scheduler->
nodes; iter != NULL; iter = iter->next) {
570 if (pcmk__is_guest_or_bundle_node(node)) {
578 if (needs_fencing(node, have_managed)) {
579 fencing = schedule_fencing(node);
585 fencing_ops = add_nondc_fencing(fencing_ops, fencing,
589 }
else if (needs_shutdown(node)) {
596 shutdown_ops = g_list_prepend(shutdown_ops, down_op);
601 integrity_lost =
true;
603 pcmk__node_name(node));
607 if (integrity_lost) {
610 "cannot be guaranteed (configure, enable, " 611 "and test fencing to correct this)");
614 crm_notice(
"Unclean nodes will not be fenced until quorum is " 620 if (dc_down != NULL) {
640 }
else if (fencing_ops != NULL) {
650 g_list_free(fencing_ops);
651 g_list_free(shutdown_ops);
664 all = g_list_prepend(all, (gpointer)
"*");
672 out->
message(out, pcmk__map_element_name(rsc->
xml), 0UL, rsc, all,
720 crm_trace(
"Required but unrunnable actions:");
722 iter != NULL; iter = iter->next) {
743 const char* localhost_save = NULL;
746 crm_trace(
"Reusing previously calculated cluster status");
765 if (localhost_save) {
815 schedule_fencing_and_shutdowns(
scheduler);
854 if (new_scheduler == NULL) {
866 if (new_scheduler->
input == NULL) {
867 out->
err(out,
"Failed to copy input XML");
pcmk_assignment_methods_t * cmds
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)
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...)
pcmk_scheduler_t * cluster
void(* create_actions)(pcmk_resource_t *rsc)
pcmk_node_t * partial_migration_target
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,...)
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)
gboolean exclusive_discover
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
G_GNUC_INTERNAL void pcmk__handle_rsc_config_changes(pcmk_scheduler_t *scheduler)
#define PCMK_ACTION_DO_SHUTDOWN
pcmk_node_t *(* assign)(pcmk_resource_t *rsc, const pcmk_node_t *prefer, bool stop_if_fail)
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.
pcmk_scheduler_t * data_set
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)
gboolean remote_requires_reset
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...)
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)
struct pe_node_shared_s * details
int(*) int(*) void(* err)(pcmk__output_t *out, const char *format,...) G_GNUC_PRINTF(2
void(* shutdown_lock)(pcmk_resource_t *rsc)
void set_working_set_defaults(pcmk_scheduler_t *scheduler)
void pcmk__register_lib_messages(pcmk__output_t *out)
#define PCMK_VALUE_IGNORE
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)
G_GNUC_INTERNAL pcmk_action_t * pcmk__new_shutdown_action(pcmk_node_t *node)
void pe__register_messages(pcmk__output_t *out)
const char * placement_strategy
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)
void pcmk__output_free(pcmk__output_t *out)
#define pcmk__assert(expr)
void pe_free_working_set(pcmk_scheduler_t *scheduler)
Free scheduler data.
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)
#define pcmk__sched_warn(fmt...)
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)
#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)
enum pcmk__digest_result rc
#define PCMK_SCORE_INFINITY
Integer score to use to represent "infinity".
GHashTable * allowed_nodes