MCPcopy Create free account
hub / github.com/ClusterLabs/pacemaker / probe_resources

Function probe_resources

pengine/allocate.c:819–895  ·  view source on GitHub ↗

* Check nodes for resources started outside of the LRM */

Source from the content-addressed store, hash-verified

817 * Check nodes for resources started outside of the LRM
818 */
819gboolean
820probe_resources(pe_working_set_t * data_set)
821{
822 action_t *probe_complete = NULL;
823 action_t *probe_node_complete = NULL;
824
825 GListPtr gIter = NULL;
826 GListPtr gIter2 = NULL;
827
828 gIter = data_set->nodes;
829 for (; gIter != NULL; gIter = gIter->next) {
830 node_t *node = (node_t *) gIter->data;
831 const char *probed = g_hash_table_lookup(node->details->attrs, CRM_OP_PROBED);
832
833 if (node->details->online == FALSE) {
834 continue;
835
836 } else if (node->details->unclean) {
837 continue;
838
839 } else if (probe_complete == NULL) {
840 probe_complete = get_pseudo_op(CRM_OP_PROBED, data_set);
841 }
842
843 if (probed != NULL && crm_is_true(probed) == FALSE) {
844 action_t *probe_op = custom_action(NULL, strdup(CRM_OP_REPROBE),
845 CRM_OP_REPROBE, node, FALSE, TRUE, data_set);
846
847 add_hash_param(probe_op->meta, XML_ATTR_TE_NOWAIT, XML_BOOLEAN_TRUE);
848 continue;
849 }
850
851 probe_node_complete = custom_action(NULL, strdup(CRM_OP_PROBED),
852 CRM_OP_PROBED, node, FALSE, TRUE, data_set);
853 if (crm_is_true(probed)) {
854 crm_trace("unset");
855 update_action_flags(probe_node_complete, pe_action_optional);
856 } else {
857 crm_trace("set");
858 update_action_flags(probe_node_complete, pe_action_optional | pe_action_clear);
859 }
860 crm_trace("%s - %d", node->details->uname, probe_node_complete->flags & pe_action_optional);
861 probe_node_complete->priority = INFINITY;
862 add_hash_param(probe_node_complete->meta, XML_ATTR_TE_NOWAIT, XML_BOOLEAN_TRUE);
863
864 if (node->details->pending) {
865 update_action_flags(probe_node_complete, pe_action_runnable | pe_action_clear);
866 crm_info("Action %s on %s is unrunnable (pending)",
867 probe_node_complete->uuid, probe_node_complete->node->details->uname);
868 }
869
870 order_actions(probe_node_complete, probe_complete,
871 pe_order_runnable_left /*|pe_order_implies_then */ );
872
873 gIter2 = data_set->resources;
874 for (; gIter2 != NULL; gIter2 = gIter2->next) {
875 resource_t *rsc = (resource_t *) gIter2->data;
876

Callers 1

stage5Function · 0.85

Calls 7

get_pseudo_opFunction · 0.85
crm_is_trueFunction · 0.85
custom_actionFunction · 0.85
add_hash_paramFunction · 0.85
update_action_flagsFunction · 0.85
order_actionsFunction · 0.85
wait_for_probeFunction · 0.85

Tested by

no test coverage detected