extern const isc::log::MessageID HA_LEASES_BACKLOG_NOTHING_TO_SEND = "HA_LEASES_BACKLOG_NOTHING_TO_SEND";
extern const isc::log::MessageID HA_LEASES_BACKLOG_START = "HA_LEASES_BACKLOG_START";
extern const isc::log::MessageID HA_LEASES_BACKLOG_SUCCESS = "HA_LEASES_BACKLOG_SUCCESS";
+extern const isc::log::MessageID HA_LEASES_SYNC_APPLIED_LEASES = "HA_LEASES_SYNC_APPLIED_LEASES";
extern const isc::log::MessageID HA_LEASES_SYNC_COMMUNICATIONS_FAILED = "HA_LEASES_SYNC_COMMUNICATIONS_FAILED";
extern const isc::log::MessageID HA_LEASES_SYNC_FAILED = "HA_LEASES_SYNC_FAILED";
extern const isc::log::MessageID HA_LEASES_SYNC_LEASE_PAGE_RECEIVED = "HA_LEASES_SYNC_LEASE_PAGE_RECEIVED";
"HA_LEASES_BACKLOG_NOTHING_TO_SEND", "%1: no leases in backlog after communication recovery",
"HA_LEASES_BACKLOG_START", "%1: starting to send %2 outstanding lease updates to %3",
"HA_LEASES_BACKLOG_SUCCESS", "%1: sending lease updates backlog to %2 successful in %3",
+ "HA_LEASES_SYNC_APPLIED_LEASES", "%1: applied %2 leases received from the partner in the local lease database",
"HA_LEASES_SYNC_COMMUNICATIONS_FAILED", "%1: failed to communicate with %2 while syncing leases: %3",
"HA_LEASES_SYNC_FAILED", "%1: failed to synchronize leases with %2: %3",
"HA_LEASES_SYNC_LEASE_PAGE_RECEIVED", "%1: received %2 leases from %3",
extern const isc::log::MessageID HA_LEASES_BACKLOG_NOTHING_TO_SEND;
extern const isc::log::MessageID HA_LEASES_BACKLOG_START;
extern const isc::log::MessageID HA_LEASES_BACKLOG_SUCCESS;
+extern const isc::log::MessageID HA_LEASES_SYNC_APPLIED_LEASES;
extern const isc::log::MessageID HA_LEASES_SYNC_COMMUNICATIONS_FAILED;
extern const isc::log::MessageID HA_LEASES_SYNC_FAILED;
extern const isc::log::MessageID HA_LEASES_SYNC_LEASE_PAGE_RECEIVED;
The third argument specifies the duration of
this operation.
+% HA_LEASES_SYNC_APPLIED_LEASES %1: applied %2 leases received from the partner in the local lease database
+This informational message outputs the number of leases received from the
+partner during the database synchronization and applied in the local database.
+A typical case when only some leases are applied is when the server has
+multiple relationships and some of the received leases belong to another
+relationship. The first argument specifies this server name. The second
+argument specifies the number of applied leases.
+
% HA_LEASES_SYNC_COMMUNICATIONS_FAILED %1: failed to communicate with %2 while syncing leases: %3
This error message is issued to indicate that there was a communication error
with a partner server while trying to fetch leases from its lease database.
.arg(leases_element.size())
.arg(server_name);
+ // Count actually applied leases.
+ uint64_t applied_lease_count = 0;
for (auto l = leases_element.begin(); l != leases_element.end(); ++l) {
try {
if (!existing_lease) {
// There is no such lease, so let's add it.
LeaseMgrFactory::instance().addLease(lease);
+ ++applied_lease_count;
} else if (existing_lease->cltt_ < lease->cltt_) {
// If the existing lease is older than the fetched lease, update
// the current expiration time value does not match what is stored.
Lease::syncCurrentExpirationTime(*existing_lease, *lease);
LeaseMgrFactory::instance().updateLease4(lease);
+ ++applied_lease_count;
} else {
LOG_DEBUG(ha_logger, DBGLVL_TRACE_BASIC, HA_LEASE_SYNC_STALE_LEASE4_SKIP)
if (!existing_lease) {
// There is no such lease, so let's add it.
LeaseMgrFactory::instance().addLease(lease);
+ ++applied_lease_count;
} else if (existing_lease->cltt_ < lease->cltt_) {
// If the existing lease is older than the fetched lease, update
// the current expiration time value does not match what is stored.
Lease::syncCurrentExpirationTime(*existing_lease, *lease);
LeaseMgrFactory::instance().updateLease6(lease);
+ ++applied_lease_count;
} else {
LOG_DEBUG(ha_logger, DBGLVL_TRACE_BASIC, HA_LEASE_SYNC_STALE_LEASE6_SKIP)
}
}
+ LOG_INFO(ha_logger, HA_LEASES_SYNC_APPLIED_LEASES)
+ .arg(config_->getThisServerName())
+ .arg(applied_lease_count);
+
} catch (const std::exception& ex) {
error_message = ex.what();
LOG_ERROR(ha_logger, HA_LEASES_SYNC_FAILED)