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

Function notify_deleted

crmd/lrm.c:804–841  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

802}
803
804static void
805notify_deleted(ha_msg_input_t * input, const char *rsc_id, int rc)
806{
807 lrmd_event_data_t *op = NULL;
808 const char *from_sys = crm_element_value(input->msg, F_CRM_SYS_FROM);
809 const char *from_host = crm_element_value(input->msg, F_CRM_HOST_FROM);
810
811 crm_info("Notifying %s on %s that %s was%s deleted",
812 from_sys, from_host, rsc_id, rc == pcmk_ok ? "" : " not");
813
814 op = construct_op(input->xml, rsc_id, CRMD_ACTION_DELETE);
815 CRM_ASSERT(op != NULL);
816
817 if (rc == pcmk_ok) {
818 op->op_status = PCMK_LRM_OP_DONE;
819 op->rc = PCMK_EXECRA_OK;
820 } else {
821 op->op_status = PCMK_LRM_OP_ERROR;
822 op->rc = PCMK_EXECRA_UNKNOWN_ERROR;
823 }
824
825 send_direct_ack(from_host, from_sys, NULL, op, rsc_id);
826 lrmd_free_event(op);
827
828 if (safe_str_neq(from_sys, CRM_SYSTEM_TENGINE)) {
829 /* this isn't expected - trigger a new transition */
830 time_t now = time(NULL);
831 char *now_s = crm_itoa(now);
832
833 crm_debug("Triggering a refresh after %s deleted %s from the LRM", from_sys, rsc_id);
834
835 update_attr_delegate(
836 fsa_cib_conn, cib_none, XML_CIB_TAG_CRMCONFIG, NULL, NULL, NULL, NULL,
837 "last-lrm-refresh", now_s, FALSE, NULL);
838
839 free(now_s);
840 }
841}
842
843static gboolean
844lrm_remove_deleted_rsc(gpointer key, gpointer value, gpointer user_data)

Callers 2

lrm_remove_deleted_rscFunction · 0.85
delete_rsc_entryFunction · 0.85

Calls 7

crm_element_valueFunction · 0.85
construct_opFunction · 0.85
send_direct_ackFunction · 0.85
lrmd_free_eventFunction · 0.85
safe_str_neqFunction · 0.85
crm_itoaFunction · 0.85
update_attr_delegateFunction · 0.85

Tested by

no test coverage detected