mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-08-31 14:05:33 +00:00
[#2408] Renamed HA parameter
The max-rejected-clients has been renamed to max-rejected-lease-updates.
This commit is contained in:
@@ -163,7 +163,7 @@ HAConfig::HAConfig()
|
||||
: this_server_name_(), ha_mode_(HOT_STANDBY), send_lease_updates_(true),
|
||||
sync_leases_(true), sync_timeout_(60000), sync_page_limit_(10000),
|
||||
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),
|
||||
http_dedicated_listener_(false), http_listener_threads_(0), http_client_threads_(0),
|
||||
trust_anchor_(), cert_file_(), key_file_(), require_client_certs_(true),
|
||||
|
@@ -563,10 +563,10 @@ public:
|
||||
/// the maximum number of clients with conflicting leases before the server
|
||||
/// transitions to the terminated state.
|
||||
///
|
||||
/// @return Maximum number of rejected clients before the server terminates the
|
||||
/// HA service.
|
||||
uint32_t getMaxRejectedClients() const {
|
||||
return (max_rejected_clients_);
|
||||
/// @return Maximum number of rejected lease updates before the server terminates
|
||||
/// the HA service.
|
||||
uint32_t getMaxRejectedLeaseUpdates() const {
|
||||
return (max_rejected_lease_updates_);
|
||||
}
|
||||
|
||||
/// @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.
|
||||
/// A special value of 0 configures the server to never transition to the
|
||||
/// terminated state as a result of the lease updates issues.
|
||||
void setMaxRejectedClients(const uint32_t max_rejected_clients) {
|
||||
max_rejected_clients_ = max_rejected_clients;
|
||||
void setMaxRejectedLeaseUpdates(const uint32_t max_rejected_lease_updates) {
|
||||
max_rejected_lease_updates_ = max_rejected_lease_updates;
|
||||
}
|
||||
|
||||
/// @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_ack_delay_; ///< Maximum DHCP message ack delay.
|
||||
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 enable_multi_threading_; ///< Enable multi-threading.
|
||||
bool http_dedicated_listener_; ///< Enable use of own HTTP listener.
|
||||
|
@@ -26,19 +26,19 @@ const SimpleDefaults HA_CONFIG_LB_DEFAULTS = {
|
||||
|
||||
/// @brief Default values for HA configuration.
|
||||
const SimpleDefaults HA_CONFIG_DEFAULTS = {
|
||||
{ "delayed-updates-limit", Element::integer, "0" },
|
||||
{ "heartbeat-delay", Element::integer, "10000" },
|
||||
{ "max-ack-delay", Element::integer, "10000" },
|
||||
{ "max-response-delay", Element::integer, "60000" },
|
||||
{ "max-unacked-clients", Element::integer, "10" },
|
||||
{ "max-rejected-clients", Element::integer, "10" },
|
||||
{ "require-client-certs", Element::boolean, "true" },
|
||||
{ "restrict-commands", Element::boolean, "false" },
|
||||
{ "send-lease-updates", Element::boolean, "true" },
|
||||
{ "sync-leases", Element::boolean, "true" },
|
||||
{ "sync-timeout", Element::integer, "60000" },
|
||||
{ "sync-page-limit", Element::integer, "10000" },
|
||||
{ "wait-backup-ack", Element::boolean, "false" }
|
||||
{ "delayed-updates-limit", Element::integer, "0" },
|
||||
{ "heartbeat-delay", Element::integer, "10000" },
|
||||
{ "max-ack-delay", Element::integer, "10000" },
|
||||
{ "max-response-delay", Element::integer, "60000" },
|
||||
{ "max-unacked-clients", Element::integer, "10" },
|
||||
{ "max-rejected-lease-updates", Element::integer, "10" },
|
||||
{ "require-client-certs", Element::boolean, "true" },
|
||||
{ "restrict-commands", Element::boolean, "false" },
|
||||
{ "send-lease-updates", Element::boolean, "true" },
|
||||
{ "sync-leases", Element::boolean, "true" },
|
||||
{ "sync-timeout", Element::integer, "60000" },
|
||||
{ "sync-page-limit", Element::integer, "10000" },
|
||||
{ "wait-backup-ack", Element::boolean, "false" }
|
||||
};
|
||||
|
||||
/// @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");
|
||||
config_storage->setMaxUnackedClients(max_unacked_clients);
|
||||
|
||||
// Get 'max-rejected-clients'.
|
||||
uint32_t max_rejected_clients = getAndValidateInteger<uint32_t>(c, "max-rejected-clients");
|
||||
config_storage->setMaxRejectedClients(max_rejected_clients);
|
||||
// Get 'max-rejected-lease-updates'.
|
||||
uint32_t max_rejected_lease_updates = getAndValidateInteger<uint32_t>(c, "max-rejected-lease-updates");
|
||||
config_storage->setMaxRejectedLeaseUpdates(max_rejected_lease_updates);
|
||||
|
||||
// Get 'wait-backup-ack'.
|
||||
config_storage->setWaitBackupAck(getBoolean(c, "wait-backup-ack"));
|
||||
|
@@ -1116,8 +1116,8 @@ HAService::shouldTerminate() const {
|
||||
// Check if we should terminate because the number of rejected leases
|
||||
// has been exceeded.
|
||||
should_terminate =
|
||||
config_->getMaxRejectedClients() &&
|
||||
(config_->getMaxRejectedClients() <= communication_state_->getRejectedLeaseUpdatesCount());
|
||||
config_->getMaxRejectedLeaseUpdates() &&
|
||||
(config_->getMaxRejectedLeaseUpdates() <= communication_state_->getRejectedLeaseUpdatesCount());
|
||||
}
|
||||
|
||||
return (should_terminate);
|
||||
|
@@ -77,7 +77,7 @@ TEST_F(HAConfigTest, configureLoadBalancing) {
|
||||
" \"max-response-delay\": 11,"
|
||||
" \"max-ack-delay\": 5,"
|
||||
" \"max-unacked-clients\": 20,"
|
||||
" \"max-rejected-clients\": 9,"
|
||||
" \"max-rejected-lease-updates\": 9,"
|
||||
" \"wait-backup-ack\": false,"
|
||||
" \"peers\": ["
|
||||
" {"
|
||||
@@ -135,7 +135,7 @@ TEST_F(HAConfigTest, configureLoadBalancing) {
|
||||
EXPECT_EQ(11, impl->getConfig()->getMaxResponseDelay());
|
||||
EXPECT_EQ(5, impl->getConfig()->getMaxAckDelay());
|
||||
EXPECT_EQ(20, impl->getConfig()->getMaxUnackedClients());
|
||||
EXPECT_EQ(9, impl->getConfig()->getMaxRejectedClients());
|
||||
EXPECT_EQ(9, impl->getConfig()->getMaxRejectedLeaseUpdates());
|
||||
EXPECT_FALSE(impl->getConfig()->amWaitingBackupAck());
|
||||
|
||||
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()->getMaxAckDelay());
|
||||
EXPECT_EQ(10, impl->getConfig()->getMaxUnackedClients());
|
||||
EXPECT_EQ(10, impl->getConfig()->getMaxRejectedClients());
|
||||
EXPECT_EQ(10, impl->getConfig()->getMaxRejectedLeaseUpdates());
|
||||
EXPECT_FALSE(impl->getConfig()->amWaitingBackupAck());
|
||||
|
||||
HAConfig::PeerConfigPtr cfg = impl->getConfig()->getThisServerConfig();
|
||||
|
Reference in New Issue
Block a user