2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-09-03 23:45:27 +00:00

[#2408] Renamed HA parameter

The max-rejected-clients has been renamed to max-rejected-lease-updates.
This commit is contained in:
Marcin Siodelski
2022-09-18 21:15:14 +02:00
parent 2a9fbfc595
commit 3648b58e2f
5 changed files with 29 additions and 29 deletions

View File

@@ -163,7 +163,7 @@ HAConfig::HAConfig()
: this_server_name_(), ha_mode_(HOT_STANDBY), send_lease_updates_(true), : this_server_name_(), ha_mode_(HOT_STANDBY), send_lease_updates_(true),
sync_leases_(true), sync_timeout_(60000), sync_page_limit_(10000), sync_leases_(true), sync_timeout_(60000), sync_page_limit_(10000),
delayed_updates_limit_(0), heartbeat_delay_(10000), max_response_delay_(60000), delayed_updates_limit_(0), heartbeat_delay_(10000), max_response_delay_(60000),
max_ack_delay_(10000), max_unacked_clients_(10), max_rejected_clients_(10), max_ack_delay_(10000), max_unacked_clients_(10), max_rejected_lease_updates_(10),
wait_backup_ack_(false), enable_multi_threading_(false), wait_backup_ack_(false), enable_multi_threading_(false),
http_dedicated_listener_(false), http_listener_threads_(0), http_client_threads_(0), http_dedicated_listener_(false), http_listener_threads_(0), http_client_threads_(0),
trust_anchor_(), cert_file_(), key_file_(), require_client_certs_(true), trust_anchor_(), cert_file_(), key_file_(), require_client_certs_(true),

View File

@@ -563,10 +563,10 @@ public:
/// the maximum number of clients with conflicting leases before the server /// the maximum number of clients with conflicting leases before the server
/// transitions to the terminated state. /// transitions to the terminated state.
/// ///
/// @return Maximum number of rejected clients before the server terminates the /// @return Maximum number of rejected lease updates before the server terminates
/// HA service. /// the HA service.
uint32_t getMaxRejectedClients() const { uint32_t getMaxRejectedLeaseUpdates() const {
return (max_rejected_clients_); return (max_rejected_lease_updates_);
} }
/// @brief Sets the maximum number of clients for which lease updates can fail /// @brief Sets the maximum number of clients for which lease updates can fail
@@ -579,8 +579,8 @@ public:
/// the lease updates can fail before the server terminates the HA service. /// the lease updates can fail before the server terminates the HA service.
/// A special value of 0 configures the server to never transition to the /// A special value of 0 configures the server to never transition to the
/// terminated state as a result of the lease updates issues. /// terminated state as a result of the lease updates issues.
void setMaxRejectedClients(const uint32_t max_rejected_clients) { void setMaxRejectedLeaseUpdates(const uint32_t max_rejected_lease_updates) {
max_rejected_clients_ = max_rejected_clients; max_rejected_lease_updates_ = max_rejected_lease_updates;
} }
/// @brief Configures the server to wait/not wait for the lease update /// @brief Configures the server to wait/not wait for the lease update
@@ -801,7 +801,7 @@ public:
uint32_t max_response_delay_; ///< Max delay in response to heartbeats. uint32_t max_response_delay_; ///< Max delay in response to heartbeats.
uint32_t max_ack_delay_; ///< Maximum DHCP message ack delay. uint32_t max_ack_delay_; ///< Maximum DHCP message ack delay.
uint32_t max_unacked_clients_; ///< Maximum number of unacked clients. uint32_t max_unacked_clients_; ///< Maximum number of unacked clients.
uint32_t max_rejected_clients_; ///< Limit of rejected clients before termination. uint32_t max_rejected_lease_updates_; ///< Limit of rejected lease updates before termination.
bool wait_backup_ack_; ///< Wait for lease update ack from backup? bool wait_backup_ack_; ///< Wait for lease update ack from backup?
bool enable_multi_threading_; ///< Enable multi-threading. bool enable_multi_threading_; ///< Enable multi-threading.
bool http_dedicated_listener_; ///< Enable use of own HTTP listener. bool http_dedicated_listener_; ///< Enable use of own HTTP listener.

View File

@@ -26,19 +26,19 @@ const SimpleDefaults HA_CONFIG_LB_DEFAULTS = {
/// @brief Default values for HA configuration. /// @brief Default values for HA configuration.
const SimpleDefaults HA_CONFIG_DEFAULTS = { const SimpleDefaults HA_CONFIG_DEFAULTS = {
{ "delayed-updates-limit", Element::integer, "0" }, { "delayed-updates-limit", Element::integer, "0" },
{ "heartbeat-delay", Element::integer, "10000" }, { "heartbeat-delay", Element::integer, "10000" },
{ "max-ack-delay", Element::integer, "10000" }, { "max-ack-delay", Element::integer, "10000" },
{ "max-response-delay", Element::integer, "60000" }, { "max-response-delay", Element::integer, "60000" },
{ "max-unacked-clients", Element::integer, "10" }, { "max-unacked-clients", Element::integer, "10" },
{ "max-rejected-clients", Element::integer, "10" }, { "max-rejected-lease-updates", Element::integer, "10" },
{ "require-client-certs", Element::boolean, "true" }, { "require-client-certs", Element::boolean, "true" },
{ "restrict-commands", Element::boolean, "false" }, { "restrict-commands", Element::boolean, "false" },
{ "send-lease-updates", Element::boolean, "true" }, { "send-lease-updates", Element::boolean, "true" },
{ "sync-leases", Element::boolean, "true" }, { "sync-leases", Element::boolean, "true" },
{ "sync-timeout", Element::integer, "60000" }, { "sync-timeout", Element::integer, "60000" },
{ "sync-page-limit", Element::integer, "10000" }, { "sync-page-limit", Element::integer, "10000" },
{ "wait-backup-ack", Element::boolean, "false" } { "wait-backup-ack", Element::boolean, "false" }
}; };
/// @brief Default values for HA multi-threading configuration. /// @brief Default values for HA multi-threading configuration.
@@ -184,9 +184,9 @@ HAConfigParser::parseInternal(const HAConfigPtr& config_storage,
uint32_t max_unacked_clients = getAndValidateInteger<uint32_t>(c, "max-unacked-clients"); uint32_t max_unacked_clients = getAndValidateInteger<uint32_t>(c, "max-unacked-clients");
config_storage->setMaxUnackedClients(max_unacked_clients); config_storage->setMaxUnackedClients(max_unacked_clients);
// Get 'max-rejected-clients'. // Get 'max-rejected-lease-updates'.
uint32_t max_rejected_clients = getAndValidateInteger<uint32_t>(c, "max-rejected-clients"); uint32_t max_rejected_lease_updates = getAndValidateInteger<uint32_t>(c, "max-rejected-lease-updates");
config_storage->setMaxRejectedClients(max_rejected_clients); config_storage->setMaxRejectedLeaseUpdates(max_rejected_lease_updates);
// Get 'wait-backup-ack'. // Get 'wait-backup-ack'.
config_storage->setWaitBackupAck(getBoolean(c, "wait-backup-ack")); config_storage->setWaitBackupAck(getBoolean(c, "wait-backup-ack"));

View File

@@ -1116,8 +1116,8 @@ HAService::shouldTerminate() const {
// Check if we should terminate because the number of rejected leases // Check if we should terminate because the number of rejected leases
// has been exceeded. // has been exceeded.
should_terminate = should_terminate =
config_->getMaxRejectedClients() && config_->getMaxRejectedLeaseUpdates() &&
(config_->getMaxRejectedClients() <= communication_state_->getRejectedLeaseUpdatesCount()); (config_->getMaxRejectedLeaseUpdates() <= communication_state_->getRejectedLeaseUpdatesCount());
} }
return (should_terminate); return (should_terminate);

View File

@@ -77,7 +77,7 @@ TEST_F(HAConfigTest, configureLoadBalancing) {
" \"max-response-delay\": 11," " \"max-response-delay\": 11,"
" \"max-ack-delay\": 5," " \"max-ack-delay\": 5,"
" \"max-unacked-clients\": 20," " \"max-unacked-clients\": 20,"
" \"max-rejected-clients\": 9," " \"max-rejected-lease-updates\": 9,"
" \"wait-backup-ack\": false," " \"wait-backup-ack\": false,"
" \"peers\": [" " \"peers\": ["
" {" " {"
@@ -135,7 +135,7 @@ TEST_F(HAConfigTest, configureLoadBalancing) {
EXPECT_EQ(11, impl->getConfig()->getMaxResponseDelay()); EXPECT_EQ(11, impl->getConfig()->getMaxResponseDelay());
EXPECT_EQ(5, impl->getConfig()->getMaxAckDelay()); EXPECT_EQ(5, impl->getConfig()->getMaxAckDelay());
EXPECT_EQ(20, impl->getConfig()->getMaxUnackedClients()); EXPECT_EQ(20, impl->getConfig()->getMaxUnackedClients());
EXPECT_EQ(9, impl->getConfig()->getMaxRejectedClients()); EXPECT_EQ(9, impl->getConfig()->getMaxRejectedLeaseUpdates());
EXPECT_FALSE(impl->getConfig()->amWaitingBackupAck()); EXPECT_FALSE(impl->getConfig()->amWaitingBackupAck());
HAConfig::PeerConfigPtr cfg = impl->getConfig()->getThisServerConfig(); HAConfig::PeerConfigPtr cfg = impl->getConfig()->getThisServerConfig();
@@ -260,7 +260,7 @@ TEST_F(HAConfigTest, configureHotStandby) {
EXPECT_EQ(10000, impl->getConfig()->getHeartbeatDelay()); EXPECT_EQ(10000, impl->getConfig()->getHeartbeatDelay());
EXPECT_EQ(10000, impl->getConfig()->getMaxAckDelay()); EXPECT_EQ(10000, impl->getConfig()->getMaxAckDelay());
EXPECT_EQ(10, impl->getConfig()->getMaxUnackedClients()); EXPECT_EQ(10, impl->getConfig()->getMaxUnackedClients());
EXPECT_EQ(10, impl->getConfig()->getMaxRejectedClients()); EXPECT_EQ(10, impl->getConfig()->getMaxRejectedLeaseUpdates());
EXPECT_FALSE(impl->getConfig()->amWaitingBackupAck()); EXPECT_FALSE(impl->getConfig()->amWaitingBackupAck());
HAConfig::PeerConfigPtr cfg = impl->getConfig()->getThisServerConfig(); HAConfig::PeerConfigPtr cfg = impl->getConfig()->getThisServerConfig();