mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-08-31 22:15:23 +00:00
@@ -386,7 +386,7 @@ public:
|
|||||||
/// unsent in the communication-recovery state.
|
/// unsent in the communication-recovery state.
|
||||||
///
|
///
|
||||||
/// If the server is in the communication-recovery state it is unable to
|
/// If the server is in the communication-recovery state it is unable to
|
||||||
/// send lease updates to the partner. Instead it keeps lease updates
|
/// send lease updates to the partner. Instead it keeps lease updates,
|
||||||
/// hoping to send them when the communication is resumed. This value
|
/// hoping to send them when the communication is resumed. This value
|
||||||
/// designates a limit of how many such updates can be held. If this
|
/// designates a limit of how many such updates can be held. If this
|
||||||
/// number is exceeded the server continues to respond to the clients
|
/// number is exceeded the server continues to respond to the clients
|
||||||
@@ -402,7 +402,7 @@ public:
|
|||||||
/// unsent in the communication-recovery state.
|
/// unsent in the communication-recovery state.
|
||||||
///
|
///
|
||||||
/// If the server is in the communication-recovery state it is unable to
|
/// If the server is in the communication-recovery state it is unable to
|
||||||
/// send lease updates to the partner. Instead it keeps lease updates
|
/// send lease updates to the partner. Instead it keeps lease updates,
|
||||||
/// hoping to send them when the communication is resumed. This value
|
/// hoping to send them when the communication is resumed. This value
|
||||||
/// designates a limit of how many such updates can be held. If this
|
/// designates a limit of how many such updates can be held. If this
|
||||||
/// number is exceeded the server continues to respond to the clients
|
/// number is exceeded the server continues to respond to the clients
|
||||||
|
@@ -82,7 +82,7 @@ HAService::defineEvents() {
|
|||||||
defineEvent(HA_MAINTENANCE_NOTIFY_EVT, "HA_MAINTENANCE_NOTIFY_EVT");
|
defineEvent(HA_MAINTENANCE_NOTIFY_EVT, "HA_MAINTENANCE_NOTIFY_EVT");
|
||||||
defineEvent(HA_MAINTENANCE_START_EVT, "HA_MAINTENANCE_START_EVT");
|
defineEvent(HA_MAINTENANCE_START_EVT, "HA_MAINTENANCE_START_EVT");
|
||||||
defineEvent(HA_MAINTENANCE_CANCEL_EVT, "HA_MAINTENANCE_CANCEL_EVT");
|
defineEvent(HA_MAINTENANCE_CANCEL_EVT, "HA_MAINTENANCE_CANCEL_EVT");
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
HAService::verifyEvents() {
|
HAService::verifyEvents() {
|
||||||
@@ -986,6 +986,9 @@ HAService::asyncSendLeaseUpdates(const dhcp::Pkt4Ptr& query,
|
|||||||
for (auto p = peers_configs.begin(); p != peers_configs.end(); ++p) {
|
for (auto p = peers_configs.begin(); p != peers_configs.end(); ++p) {
|
||||||
HAConfig::PeerConfigPtr conf = p->second;
|
HAConfig::PeerConfigPtr conf = p->second;
|
||||||
|
|
||||||
|
// Check if the lease updates should be queued. This is the case when the
|
||||||
|
// server is in the communication-recovery state. Queued lease updates may
|
||||||
|
// be sent when the communication is re-established.
|
||||||
if (shouldQueueLeaseUpdates(conf)) {
|
if (shouldQueueLeaseUpdates(conf)) {
|
||||||
// Lease updates for deleted leases.
|
// Lease updates for deleted leases.
|
||||||
for (auto l = deleted_leases->begin(); l != deleted_leases->end(); ++l) {
|
for (auto l = deleted_leases->begin(); l != deleted_leases->end(); ++l) {
|
||||||
@@ -1044,6 +1047,9 @@ HAService::asyncSendLeaseUpdates(const dhcp::Pkt6Ptr& query,
|
|||||||
for (auto p = peers_configs.begin(); p != peers_configs.end(); ++p) {
|
for (auto p = peers_configs.begin(); p != peers_configs.end(); ++p) {
|
||||||
HAConfig::PeerConfigPtr conf = p->second;
|
HAConfig::PeerConfigPtr conf = p->second;
|
||||||
|
|
||||||
|
// Check if the lease updates should be queued. This is the case when the
|
||||||
|
// server is in the communication-recovery state. Queued lease updates may
|
||||||
|
// be sent when the communication is re-established.
|
||||||
if (shouldQueueLeaseUpdates(conf)) {
|
if (shouldQueueLeaseUpdates(conf)) {
|
||||||
for (auto l = deleted_leases->begin(); l != deleted_leases->end(); ++l) {
|
for (auto l = deleted_leases->begin(); l != deleted_leases->end(); ++l) {
|
||||||
lease6_update_backlog_.push(Lease6UpdateBacklog::DELETE, *l);
|
lease6_update_backlog_.push(Lease6UpdateBacklog::DELETE, *l);
|
||||||
@@ -2120,6 +2126,11 @@ HAService::asyncSendLeaseUpdatesFromBacklog(HttpClient& http_client,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Recursively send all outstanding lease updates or break when an
|
||||||
|
// error occurs. In DHCPv6, this is a single iteration because we use
|
||||||
|
// lease6-bulk-apply, which combines many lease updates in a single
|
||||||
|
// transaction. In the case of DHCPv4, each update is sent in its own
|
||||||
|
// transaction.
|
||||||
if (error_message.empty()) {
|
if (error_message.empty()) {
|
||||||
asyncSendLeaseUpdatesFromBacklog(http_client, config, post_request_action);
|
asyncSendLeaseUpdatesFromBacklog(http_client, config, post_request_action);
|
||||||
} else {
|
} else {
|
||||||
|
@@ -141,9 +141,12 @@ public:
|
|||||||
/// tries to send them in bulk when it returns to the
|
/// tries to send them in bulk when it returns to the
|
||||||
/// load-balancing state.
|
/// load-balancing state.
|
||||||
///
|
///
|
||||||
/// A server running in the hot-standby mode never enters this
|
/// Transitioning into this state is only enabled when delayed-updates-limit
|
||||||
/// state. In this mode, even a short communication failure may
|
/// is non-zero.
|
||||||
/// cause the primary server to transition to the partner-down
|
///
|
||||||
|
/// A server running in the hot-standby mode is never allowed to
|
||||||
|
/// enter this state. In this mode, even a short communication failure
|
||||||
|
/// may cause the primary server to transition to the partner-down
|
||||||
/// state. Consequently, two servers would be responding to
|
/// state. Consequently, two servers would be responding to
|
||||||
/// DHCP queries, possibly allocating the same addresses to two
|
/// DHCP queries, possibly allocating the same addresses to two
|
||||||
/// different clients. This doesn't occur in load-balancing mode
|
/// different clients. This doesn't occur in load-balancing mode
|
||||||
@@ -813,6 +816,9 @@ protected:
|
|||||||
/// It instructs the server to disable the DHCP service on the HA peer,
|
/// It instructs the server to disable the DHCP service on the HA peer,
|
||||||
/// fetch all leases from the peer and update the local lease database.
|
/// fetch all leases from the peer and update the local lease database.
|
||||||
///
|
///
|
||||||
|
/// This method creates its own instances of the HttpClient and IOService and
|
||||||
|
/// invokes IOService::run().
|
||||||
|
///
|
||||||
/// @param [out] status_message status message in textual form.
|
/// @param [out] status_message status message in textual form.
|
||||||
/// @param server_name name of the server to fetch leases from.
|
/// @param server_name name of the server to fetch leases from.
|
||||||
/// @param max_period maximum number of seconds to disable DHCP service
|
/// @param max_period maximum number of seconds to disable DHCP service
|
||||||
@@ -854,6 +860,9 @@ protected:
|
|||||||
/// operation in the load-balancing state. In order to prevent collisions
|
/// operation in the load-balancing state. In order to prevent collisions
|
||||||
/// between new allocations and oustanding updates this method is synchronous.
|
/// between new allocations and oustanding updates this method is synchronous.
|
||||||
///
|
///
|
||||||
|
/// This method creates its own instances of the HttpClient and IOService and
|
||||||
|
/// invokes IOService::run().
|
||||||
|
///
|
||||||
/// @return boolean value indicating that the lease updates were delivered
|
/// @return boolean value indicating that the lease updates were delivered
|
||||||
/// successfully (when true) or unsuccessfully (when false).
|
/// successfully (when true) or unsuccessfully (when false).
|
||||||
bool sendLeaseUpdatesFromBacklog();
|
bool sendLeaseUpdatesFromBacklog();
|
||||||
@@ -906,6 +915,9 @@ public:
|
|||||||
/// state and signal an error to the caller. If the partner is unavailable,
|
/// state and signal an error to the caller. If the partner is unavailable,
|
||||||
/// this server will directly transition to the partner-down state.
|
/// this server will directly transition to the partner-down state.
|
||||||
///
|
///
|
||||||
|
/// This method creates its own instances of the HttpClient and IOService and
|
||||||
|
/// invokes IOService::run().
|
||||||
|
///
|
||||||
/// @return Pointer to the response to the ha-maintenance-start.
|
/// @return Pointer to the response to the ha-maintenance-start.
|
||||||
data::ConstElementPtr processMaintenanceStart();
|
data::ConstElementPtr processMaintenanceStart();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user