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

Function config_query_callback

crmd/control.c:783–850  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

781}
782
783static void
784config_query_callback(xmlNode * msg, int call_id, int rc, xmlNode * output, void *user_data)
785{
786 const char *value = NULL;
787 GHashTable *config_hash = NULL;
788 crm_time_t *now = crm_time_new(NULL);
789
790 if (rc != pcmk_ok) {
791 fsa_data_t *msg_data = NULL;
792
793 crm_err("Local CIB query resulted in an error: %s", pcmk_strerror(rc));
794 register_fsa_error(C_FSA_INTERNAL, I_ERROR, NULL);
795
796 if (rc == -EACCES || rc == -pcmk_err_dtd_validation) {
797 crm_err("The cluster is mis-configured - shutting down and staying down");
798 set_bit(fsa_input_register, R_STAYDOWN);
799 }
800 goto bail;
801 }
802
803 crm_debug("Call %d : Parsing CIB options", call_id);
804 config_hash =
805 g_hash_table_new_full(crm_str_hash, g_str_equal, g_hash_destroy_str, g_hash_destroy_str);
806
807 unpack_instance_attributes(output, output, XML_CIB_TAG_PROPSET, NULL, config_hash,
808 CIB_OPTIONS_FIRST, FALSE, now);
809
810 verify_crmd_options(config_hash);
811
812 value = crmd_pref(config_hash, XML_CONFIG_ATTR_DC_DEADTIME);
813 election_trigger->period_ms = crm_get_msec(value);
814
815 value = crmd_pref(config_hash, XML_CONFIG_ATTR_FORCE_QUIT);
816 shutdown_escalation_timer->period_ms = crm_get_msec(value);
817 crm_debug("Shutdown escalation occurs after: %dms", shutdown_escalation_timer->period_ms);
818
819 value = crmd_pref(config_hash, XML_CONFIG_ATTR_ELECTION_FAIL);
820 election_timeout->period_ms = crm_get_msec(value);
821
822 value = crmd_pref(config_hash, XML_CONFIG_ATTR_RECHECK);
823 recheck_timer->period_ms = crm_get_msec(value);
824 crm_debug("Checking for expired actions every %dms", recheck_timer->period_ms);
825
826 value = crmd_pref(config_hash, "crmd-transition-delay");
827 transition_timer->period_ms = crm_get_msec(value);
828
829 value = crmd_pref(config_hash, "crmd-integration-timeout");
830 integration_timer->period_ms = crm_get_msec(value);
831
832 value = crmd_pref(config_hash, "crmd-finalization-timeout");
833 finalization_timer->period_ms = crm_get_msec(value);
834
835#if SUPPORT_COROSYNC
836 if (is_classic_ais_cluster()) {
837 value = crmd_pref(config_hash, XML_ATTR_EXPECTED_VOTES);
838 crm_debug("Sending expected-votes=%s to corosync", value);
839 send_ais_text(crm_class_quorum, value, TRUE, NULL, crm_msg_ais);
840 }

Callers

nothing calls this directly

Calls 10

crm_time_newFunction · 0.85
pcmk_strerrorFunction · 0.85
verify_crmd_optionsFunction · 0.85
crmd_prefFunction · 0.85
crm_get_msecFunction · 0.85
is_classic_ais_clusterFunction · 0.85
mainloop_set_triggerFunction · 0.85
crm_time_freeFunction · 0.85
send_ais_textFunction · 0.50

Tested by

no test coverage detected