diff --git a/include/crm/common/scheduler.h b/include/crm/common/scheduler.h index 79419ea9d1..805c316786 100644 --- a/include/crm/common/scheduler.h +++ b/include/crm/common/scheduler.h @@ -1,167 +1,230 @@ /* * Copyright 2004-2023 the Pacemaker project contributors * * The version control history for this file may have further details. * * This source code is licensed under the GNU Lesser General Public License * version 2.1 or later (LGPLv2.1+) WITHOUT ANY WARRANTY. */ #ifndef PCMK__CRM_COMMON_SCHEDULER__H # define PCMK__CRM_COMMON_SCHEDULER__H +#include // time_t +#include // xmlNode +#include // guint, GList, GHashTable + +#include // crm_time_t + #include #include #include #include #include #ifdef __cplusplus extern "C" { #endif /*! * \file * \brief Scheduler API * \ingroup core */ //! Possible responses to loss of quorum enum pe_quorum_policy { pcmk_no_quorum_freeze, // pe_tag_t *) + int blocked_resources; //!< Number of blocked resources in cluster + int disabled_resources; //!< Number of disabled resources in cluster + GList *param_check; //!< History entries that need to be checked + GList *stop_needed; //!< Containers that need stop actions + time_t recheck_by; //!< Hint to controller when to reschedule + int ninstances; //!< Total number of resource instances + guint shutdown_lock; //!< How long to lock resources (seconds) + int priority_fencing_delay; //!< Priority fencing delay + + // pcmk__output_t * + void *priv; //!< For Pacemaker use only + + guint node_pending_timeout; //!< Pending join times out after this (ms) +}; + #ifdef __cplusplus } #endif #endif // PCMK__CRM_COMMON_SCHEDULER__H diff --git a/include/crm/pengine/pe_types.h b/include/crm/pengine/pe_types.h index dd8c528fae..0726d8e95d 100644 --- a/include/crm/pengine/pe_types.h +++ b/include/crm/pengine/pe_types.h @@ -1,218 +1,158 @@ /* * Copyright 2004-2023 the Pacemaker project contributors * * The version control history for this file may have further details. * * This source code is licensed under the GNU Lesser General Public License * version 2.1 or later (LGPLv2.1+) WITHOUT ANY WARRANTY. */ #ifndef PCMK__CRM_PENGINE_PE_TYPES__H # define PCMK__CRM_PENGINE_PE_TYPES__H # include // bool # include // time_t # include // xmlNode # include // gboolean, guint, GList, GHashTable # include # include # include #ifdef __cplusplus extern "C" { #endif /*! * \file * \brief Data types for cluster status * \ingroup pengine */ -struct pe_working_set_s { - xmlNode *input; - crm_time_t *now; - - /* options extracted from the input */ - char *dc_uuid; - pcmk_node_t *dc_node; - const char *stonith_action; - const char *placement_strategy; - - unsigned long long flags; - - int stonith_timeout; - enum pe_quorum_policy no_quorum_policy; - - GHashTable *config_hash; - GHashTable *tickets; - - // Actions for which there can be only one (e.g. fence nodeX) - GHashTable *singletons; - - GList *nodes; - GList *resources; - GList *placement_constraints; - GList *ordering_constraints; - GList *colocation_constraints; - GList *ticket_constraints; - - GList *actions; - xmlNode *failed; - xmlNode *op_defaults; - xmlNode *rsc_defaults; - - /* stats */ - int num_synapse; - int max_valid_nodes; //! Deprecated (will be removed in a future release) - int order_id; - int action_id; - - /* final output */ - xmlNode *graph; - - GHashTable *template_rsc_sets; - const char *localhost; - GHashTable *tags; - - int blocked_resources; - int disabled_resources; - - GList *param_check; // History entries that need to be checked - GList *stop_needed; // Containers that need stop actions - time_t recheck_by; // Hint to controller to re-run scheduler by this time - int ninstances; // Total number of resource instances - guint shutdown_lock;// How long (seconds) to lock resources to shutdown node - int priority_fencing_delay; // Priority fencing delay - - void *priv; - guint node_pending_timeout; // Node pending timeout -}; - struct pe_action_s { int id; int priority; pcmk_resource_t *rsc; pcmk_node_t *node; xmlNode *op_entry; char *task; char *uuid; char *cancel_task; char *reason; enum pe_action_flags flags; enum rsc_start_requirement needs; enum action_fail_response on_fail; enum rsc_role_e fail_role; GHashTable *meta; GHashTable *extra; /* * These two varables are associated with the constraint logic * that involves first having one or more actions runnable before * then allowing this action to execute. * * These varables are used with features such as 'clone-min' which * requires at minimum X number of cloned instances to be running * before an order dependency can run. Another option that uses * this is 'require-all=false' in ordering constrants. This option * says "only require one instance of a resource to start before * allowing dependencies to start" -- basically, require-all=false is * the same as clone-min=1. */ /* current number of known runnable actions in the before list. */ int runnable_before; /* the number of "before" runnable actions required for this action * to be considered runnable */ int required_runnable_before; GList *actions_before; /* pe_action_wrapper_t* */ GList *actions_after; /* pe_action_wrapper_t* */ /* Some of the above fields could be moved to the details, * except for API backward compatibility. */ void *action_details; // varies by type of action }; typedef struct pe_ticket_s { char *id; gboolean granted; time_t last_granted; gboolean standby; GHashTable *state; } pe_ticket_t; typedef struct pe_tag_s { char *id; GList *refs; } pe_tag_t; //!@{ //! \deprecated Do not use enum pe_ordering { pe_order_none = 0x0, /* deleted */ #if !defined(PCMK_ALLOW_DEPRECATED) || (PCMK_ALLOW_DEPRECATED == 1) pe_order_optional = 0x1, /* pure ordering, nothing implied */ pe_order_apply_first_non_migratable = 0x2, /* Only apply this constraint's ordering if first is not migratable. */ pe_order_implies_first = 0x10, /* If 'then' is required, ensure 'first' is too */ pe_order_implies_then = 0x20, /* If 'first' is required, ensure 'then' is too */ pe_order_promoted_implies_first = 0x40, /* If 'then' is required and then's rsc is promoted, ensure 'first' becomes required too */ /* first requires then to be both runnable and migrate runnable. */ pe_order_implies_first_migratable = 0x80, pe_order_runnable_left = 0x100, /* 'then' requires 'first' to be runnable */ pe_order_pseudo_left = 0x200, /* 'then' can only be pseudo if 'first' is runnable */ pe_order_implies_then_on_node = 0x400, /* If 'first' is required on 'nodeX', * ensure instances of 'then' on 'nodeX' are too. * Only really useful if 'then' is a clone and 'first' is not */ pe_order_probe = 0x800, /* If 'first->rsc' is * - running but about to stop, ignore the constraint * - otherwise, behave as runnable_left */ pe_order_restart = 0x1000, /* 'then' is runnable if 'first' is optional or runnable */ pe_order_stonith_stop = 0x2000, pe_order_serialize_only = 0x4000, /* serialize */ pe_order_same_node = 0x8000, /* applies only if 'first' and 'then' are on same node */ pe_order_implies_first_printed = 0x10000, /* Like ..implies_first but only ensures 'first' is printed, not mandatory */ pe_order_implies_then_printed = 0x20000, /* Like ..implies_then but only ensures 'then' is printed, not mandatory */ pe_order_asymmetrical = 0x100000, /* Indicates asymmetrical one way ordering constraint. */ pe_order_load = 0x200000, /* Only relevant if... */ pe_order_one_or_more = 0x400000, /* 'then' is runnable only if one or more of its dependencies are too */ pe_order_anti_colocation = 0x800000, pe_order_preserve = 0x1000000, /* Hack for breaking user ordering constraints with container resources */ pe_order_then_cancels_first = 0x2000000, // if 'then' becomes required, 'first' becomes optional pe_order_trace = 0x4000000, /* test marker */ pe_order_implies_first_master = pe_order_promoted_implies_first, #endif }; //!@} typedef struct pe_action_wrapper_s { enum pe_ordering type; enum pe_link_state state; pcmk_action_t *action; } pe_action_wrapper_t; #if !defined(PCMK_ALLOW_DEPRECATED) || (PCMK_ALLOW_DEPRECATED == 1) #include #endif #ifdef __cplusplus } #endif #endif // PCMK__CRM_PENGINE_PE_TYPES__H