diff --git a/src/hooks/dhcp/high_availability/ha_config.cc b/src/hooks/dhcp/high_availability/ha_config.cc index 865a59a31f..67c2f8db06 100644 --- a/src/hooks/dhcp/high_availability/ha_config.cc +++ b/src/hooks/dhcp/high_availability/ha_config.cc @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -412,10 +413,8 @@ HAConfig::validate() { CfgMultiThreading::extract(mcfg, dhcp_mt_enabled, dhcp_threads, dummy_queue_size); if (!dhcp_mt_enabled) { - // @todo replace with a WARNING log - std::cout << "HA multi-threading cannot be enabled when" - << " Kea core multi-threading is disabled" - << std::endl; + // HA+MT requires DHCP multi-threading. + LOG_INFO(ha_logger, HA_CONFIG_DHCP_MT_DISABLED); enable_multi_threading_ = false; return; } @@ -425,8 +424,7 @@ HAConfig::validate() { dhcp_threads = MultiThreadingMgr::detectThreadCount(); // If machine says it cannot support threads. if (!dhcp_threads) { - // @todo - this needs a WARNING log - std::cout << "DHCP threads is 0, but detectThreadCount returns 0" << std::endl; + LOG_INFO(ha_logger, HA_CONFIG_SYSTEM_MT_UNSUPPORTED); enable_multi_threading_ = false; return; } diff --git a/src/hooks/dhcp/high_availability/ha_messages.cc b/src/hooks/dhcp/high_availability/ha_messages.cc index 00a6de805c..deaca724a0 100644 --- a/src/hooks/dhcp/high_availability/ha_messages.cc +++ b/src/hooks/dhcp/high_availability/ha_messages.cc @@ -24,11 +24,13 @@ extern const isc::log::MessageID HA_COMMUNICATION_INTERRUPTED_CLIENT6_UNACKED = extern const isc::log::MessageID HA_CONFIGURATION_FAILED = "HA_CONFIGURATION_FAILED"; extern const isc::log::MessageID HA_CONFIGURATION_SUCCESSFUL = "HA_CONFIGURATION_SUCCESSFUL"; extern const isc::log::MessageID HA_CONFIG_AUTO_FAILOVER_DISABLED = "HA_CONFIG_AUTO_FAILOVER_DISABLED"; +extern const isc::log::MessageID HA_CONFIG_DHCP_MT_DISABLED = "HA_CONFIG_DHCP_MT_DISABLED"; extern const isc::log::MessageID HA_CONFIG_LEASE_SYNCING_DISABLED = "HA_CONFIG_LEASE_SYNCING_DISABLED"; extern const isc::log::MessageID HA_CONFIG_LEASE_SYNCING_DISABLED_REMINDER = "HA_CONFIG_LEASE_SYNCING_DISABLED_REMINDER"; extern const isc::log::MessageID HA_CONFIG_LEASE_UPDATES_AND_SYNCING_DIFFER = "HA_CONFIG_LEASE_UPDATES_AND_SYNCING_DIFFER"; extern const isc::log::MessageID HA_CONFIG_LEASE_UPDATES_DISABLED = "HA_CONFIG_LEASE_UPDATES_DISABLED"; extern const isc::log::MessageID HA_CONFIG_LEASE_UPDATES_DISABLED_REMINDER = "HA_CONFIG_LEASE_UPDATES_DISABLED_REMINDER"; +extern const isc::log::MessageID HA_CONFIG_SYSTEM_MT_UNSUPPORTED = "HA_CONFIG_SYSTEM_MT_UNSUPPORTED"; extern const isc::log::MessageID HA_CONTINUE_HANDLER_FAILED = "HA_CONTINUE_HANDLER_FAILED"; extern const isc::log::MessageID HA_DEINIT_OK = "HA_DEINIT_OK"; extern const isc::log::MessageID HA_DHCP4_START_SERVICE_FAILED = "HA_DHCP4_START_SERVICE_FAILED"; @@ -121,11 +123,13 @@ const char* values[] = { "HA_CONFIGURATION_FAILED", "failed to configure High Availability hooks library: %1", "HA_CONFIGURATION_SUCCESSFUL", "HA hook library has been successfully configured", "HA_CONFIG_AUTO_FAILOVER_DISABLED", "auto-failover disabled for %1", + "HA_CONFIG_DHCP_MT_DISABLED", "HA multi-threading has been disabled, it cannot be enabled when Kea global multi-threading is disabled", "HA_CONFIG_LEASE_SYNCING_DISABLED", "lease database synchronization between HA servers is disabled", "HA_CONFIG_LEASE_SYNCING_DISABLED_REMINDER", "bypassing SYNCING state because lease database synchronization is administratively disabled", "HA_CONFIG_LEASE_UPDATES_AND_SYNCING_DIFFER", "unusual configuration where \"send-lease-updates\": %1 and \"sync-leases\": %2", "HA_CONFIG_LEASE_UPDATES_DISABLED", "lease updates will not be generated", "HA_CONFIG_LEASE_UPDATES_DISABLED_REMINDER", "lease updates are administratively disabled and will not be generated while in %1 state", + "HA_CONFIG_SYSTEM_MT_UNSUPPORTED", "HA multi-threading has been disabled, auto-detection of thread support reports 0", "HA_CONTINUE_HANDLER_FAILED", "ha-continue command failed: %1", "HA_DEINIT_OK", "unloading High Availability hooks library successful", "HA_DHCP4_START_SERVICE_FAILED", "failed to start DHCPv4 HA service in dhcp4_srv_configured callout: %1", diff --git a/src/hooks/dhcp/high_availability/ha_messages.h b/src/hooks/dhcp/high_availability/ha_messages.h index 0f5d1fd951..8750df2866 100644 --- a/src/hooks/dhcp/high_availability/ha_messages.h +++ b/src/hooks/dhcp/high_availability/ha_messages.h @@ -25,11 +25,13 @@ extern const isc::log::MessageID HA_COMMUNICATION_INTERRUPTED_CLIENT6_UNACKED; extern const isc::log::MessageID HA_CONFIGURATION_FAILED; extern const isc::log::MessageID HA_CONFIGURATION_SUCCESSFUL; extern const isc::log::MessageID HA_CONFIG_AUTO_FAILOVER_DISABLED; +extern const isc::log::MessageID HA_CONFIG_DHCP_MT_DISABLED; extern const isc::log::MessageID HA_CONFIG_LEASE_SYNCING_DISABLED; extern const isc::log::MessageID HA_CONFIG_LEASE_SYNCING_DISABLED_REMINDER; extern const isc::log::MessageID HA_CONFIG_LEASE_UPDATES_AND_SYNCING_DIFFER; extern const isc::log::MessageID HA_CONFIG_LEASE_UPDATES_DISABLED; extern const isc::log::MessageID HA_CONFIG_LEASE_UPDATES_DISABLED_REMINDER; +extern const isc::log::MessageID HA_CONFIG_SYSTEM_MT_UNSUPPORTED; extern const isc::log::MessageID HA_CONTINUE_HANDLER_FAILED; extern const isc::log::MessageID HA_DEINIT_OK; extern const isc::log::MessageID HA_DHCP4_START_SERVICE_FAILED; diff --git a/src/hooks/dhcp/high_availability/ha_messages.mes b/src/hooks/dhcp/high_availability/ha_messages.mes index 1e64162f92..67cb4a7b8d 100644 --- a/src/hooks/dhcp/high_availability/ha_messages.mes +++ b/src/hooks/dhcp/high_availability/ha_messages.mes @@ -154,6 +154,17 @@ are administratively disabled and will not be issued in the HA state to which the server has transitioned. The sole argument specifies the state into which the server has transitioned. +% HA_CONFIG_DHCP_MT_DISABLED HA multi-threading has been disabled, it cannot be enabled when Kea global multi-threading is disabled +This informational message is issued when HA configuration has enabled +multi-threading while Kea global configuration has multi-threading disabled. + +% HA_CONFIG_SYSTEM_MT_UNSUPPORTED HA multi-threading has been disabled, auto-detection of thread support reports 0 +This informational message is issued when HA multi-threading configuration has +specified auto-detection for the number of threads to use and the system +reports the number of concurrent threads as 0. If you now your system can +support multiple threads, then you may override this condition by specifying +explicit values for http-listener-threads and http-client-threads. + % HA_CONTINUE_HANDLER_FAILED ha-continue command failed: %1 This error message is issued to indicate that the ha-continue command handler failed while processing the command. The argument provides the reason for