12 #include <sys/param.h> 64 if ((first_rsc != NULL) && (then_action != NULL)) {
67 then_action->
rsc, NULL, then_action,
79 if ((first_action != NULL) && (then_rsc != NULL)) {
98 cluster_node = pcmk__current_node(remote_rsc);
140 }
else if (cluster_node == NULL) {
178 if (
action->rsc == NULL) {
184 remote_rsc =
action->node->priv->remote;
187 crm_trace(
"Order %s action %s relative to %s%s (state: %s)",
190 remote_rsc->
id, state2text(state));
212 order_start_then_action(remote_rsc,
action, order_opts);
217 order_action_then_stop(
action, remote_rsc,
228 "resources are active but " 229 "connection is unrecoverable",
237 order_action_then_stop(
action, remote_rsc,
267 order_start_then_action(remote_rsc,
action,
271 pcmk_node_t *cluster_node = pcmk__current_node(remote_rsc);
280 "resources are in unknown state " 281 "and connection is unrecoverable", FALSE);
289 order_action_then_stop(
action, remote_rsc,
310 remote_rsc =
action->node->priv->remote;
318 "container failed", FALSE);
321 crm_trace(
"Order %s action %s relative to %s%s for %s%s",
340 order_start_then_action(launcher,
action,
377 order_start_then_action(remote_rsc,
action,
400 crm_trace(
"Creating remote connection orderings");
403 iter != NULL; iter = iter->next) {
408 if (
action->rsc == NULL) {
429 if (
action->node == NULL) {
433 if (!pcmk__is_pacemaker_remote_node(
action->node)) {
447 remote =
action->node->priv->remote;
448 if (remote == NULL) {
459 for (GList *item =
action->rsc->priv->actions; item != NULL;
463 if (!pcmk__same_node(rsc_action->
node,
action->node)
467 action->rsc, NULL, rsc_action,
484 apply_launcher_ordering(
action);
488 apply_remote_ordering(
action);
504 return pcmk__is_remote_node(node) && (node->
priv->
remote != NULL)
522 return (rsc != NULL) && (rsc->
priv->
launched != NULL) && (node != NULL)
546 bool partial_migration =
false;
547 const char *task =
action->task;
551 || !pcmk__is_pacemaker_remote_node(
action->node)) {
555 remote =
action->node->priv->remote;
558 began_on = pcmk__current_node(remote);
562 partial_migration =
true;
565 if (began_on == NULL) {
566 crm_trace(
"Routing %s for %s through remote connection's " 567 "next node %s (starting)%s",
569 (ended_on? ended_on->
priv->
name :
"none"),
570 partial_migration?
" (partial migration)" :
"");
574 if (ended_on == NULL) {
575 crm_trace(
"Routing %s for %s through remote connection's " 576 "current node %s (stopping)%s",
578 (began_on? began_on->
priv->
name :
"none"),
579 partial_migration?
" (partial migration)" :
"");
583 if (pcmk__same_node(began_on, ended_on)) {
584 crm_trace(
"Routing %s for %s through remote connection's " 585 "current node %s (not moving)%s",
587 (began_on? began_on->
priv->
name :
"none"),
588 partial_migration?
" (partial migration)" :
"");
600 task = g_hash_table_lookup(
action->meta,
"notify_operation");
618 && !partial_migration) {
619 crm_trace(
"Routing %s for %s through remote connection's " 620 "current node %s (moving)%s",
622 (began_on? began_on->
priv->
name :
"none"),
623 partial_migration?
" (partial migration)" :
"");
631 crm_trace(
"Routing %s for %s through remote connection's " 632 "next node %s (moving)%s",
634 (ended_on? ended_on->
priv->
name :
"none"),
635 partial_migration?
" (partial migration)" :
"");
660 if (remote_addr != NULL) {
689 if (!pcmk__is_guest_or_bundle_node(guest)) {
697 "notify_operation"));
706 host = pcmk__current_node(launcher);
724 g_hash_table_lookup(
action->rsc->priv->meta,
729 (gpointer) args_xml);
731 (gpointer)
host->priv->name,
732 (gpointer) args_xml);
bool pe__shutdown_requested(const pcmk_node_t *node)
'then' is runnable (and migratable) only if 'first' is runnable
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)
bool pcmk__strcase_any_of(const char *s,...) G_GNUC_NULL_TERMINATED
#define PCMK_META_CONTAINER_ATTRIBUTE_TARGET
#define PCMK_REMOTE_RA_ADDR
pcmk__scheduler_private_t * priv
#define PCMK_ACTION_MIGRATE_TO
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.
pcmk_node_t * pcmk__connection_host_for_action(const pcmk_action_t *action)
#define PCMK_ACTION_CLEAR_FAILCOUNT
G_GNUC_INTERNAL bool pcmk__action_is_recurring(const pcmk_action_t *action)
Ordering applies even if 'first' runs on guest node created by 'then'.
#define pcmk__set_relation_flags(ar_flags, flags_to_set)
pcmk_node_t * partial_migration_source
pcmk__node_private_t * priv
#define PCMK_ACTION_DEMOTE
pcmk_scheduler_t * scheduler
Actions are ordered (optionally, if no other flags are set)
#define crm_trace(fmt, args...)
pcmk_node_t * assigned_node
#define pcmk_is_set(g, f)
Convenience alias for pcmk_all_flags_set(), to check single flag.
#define PCMK_ACTION_START
pcmk__resource_private_t * priv
Wrappers for and extensions to libxml2.
enum rsc_role_e next_role
#define PCMK__META_PHYSICAL_HOST
#define PCMK_ACTION_STONITH
char * pcmk__op_key(const char *rsc_id, const char *op_type, guint interval_ms)
Generate an operation key (RESOURCE_ACTION_INTERVAL)
#define PCMK_ACTION_CANCEL
void pcmk__substitute_remote_addr(pcmk_resource_t *rsc, GHashTable *params)
void pcmk__add_guest_meta_to_xml(xmlNode *args_xml, const pcmk_action_t *action)
Add special guest node meta-attributes to XML.
#define pcmk__assert(expr)
void pcmk__order_remote_connection_actions(pcmk_scheduler_t *scheduler)
Cluster status and scheduling.
pcmk_scheduler_t * scheduler
guint remote_reconnect_ms
enum pcmk__action_type pcmk__parse_action(const char *action_name)
pcmk_resource_t * launcher
#define PCMK_ACTION_MIGRATE_FROM
bool pcmk__is_failed_remote_node(const pcmk_node_t *node)
void hash2metafield(gpointer key, gpointer value, gpointer user_data)
Set XML attribute based on hash table entry, as meta-attribute name.
GHashTable * pe_rsc_params(pcmk_resource_t *rsc, const pcmk_node_t *node, pcmk_scheduler_t *scheduler)
Get a table of resource parameters.
struct pcmk__node_details * details
void pcmk__insert_dup(GHashTable *table, const char *name, const char *value)
bool pcmk__rsc_corresponds_to_guest(const pcmk_resource_t *rsc, const pcmk_node_t *node)
#define PCMK_ACTION_NOTIFY
No relation (compare with equality rather than bit set)
pcmk_node_t * partial_migration_target