summaryrefslogtreecommitdiffstats
path: root/src/lib/dhcpsrv/memfile_lease_mgr.cc
diff options
context:
space:
mode:
authorFrancis Dupont <fdupont@isc.org>2023-05-24 10:56:38 +0200
committerFrancis Dupont <fdupont@isc.org>2023-07-06 22:11:32 +0200
commit400ca653c0e127a130162be9cc22089b98139f46 (patch)
tree3b87e3183783ef16b8ffd3c0123aaa8e362cd3e3 /src/lib/dhcpsrv/memfile_lease_mgr.cc
parent[#2869] Checkpoint: added statements (diff)
downloadkea-400ca653c0e127a130162be9cc22089b98139f46.tar.xz
kea-400ca653c0e127a130162be9cc22089b98139f46.zip
[#2869] Checkpoint: made buildExtendedInfoTables6 memfile only
Diffstat (limited to 'src/lib/dhcpsrv/memfile_lease_mgr.cc')
-rw-r--r--src/lib/dhcpsrv/memfile_lease_mgr.cc25
1 files changed, 5 insertions, 20 deletions
diff --git a/src/lib/dhcpsrv/memfile_lease_mgr.cc b/src/lib/dhcpsrv/memfile_lease_mgr.cc
index 24bdc170f2..1914cf3e77 100644
--- a/src/lib/dhcpsrv/memfile_lease_mgr.cc
+++ b/src/lib/dhcpsrv/memfile_lease_mgr.cc
@@ -997,7 +997,7 @@ Memfile_LeaseMgr::Memfile_LeaseMgr(const DatabaseConnection::ParameterMap& param
CSVLeaseFile6>(file6,
lease_file6_,
storage6_);
- static_cast<void>(buildExtendedInfoTables6Internal(false, false));
+ buildExtendedInfoTables6();
}
}
@@ -3399,17 +3399,11 @@ Memfile_LeaseMgr::upgradeExtendedInfo4(const LeasePageSize& /* page_size */) {
return (0);
}
-size_t
-Memfile_LeaseMgr::buildExtendedInfoTables6Internal(bool update, bool current) {
- CfgConsistencyPtr cfg;
- if (current) {
- cfg = CfgMgr::instance().getCurrentCfg()->getConsistency();
- } else {
- cfg = CfgMgr::instance().getStagingCfg()->getConsistency();
- }
+void
+Memfile_LeaseMgr::buildExtendedInfoTables6() {
+ CfgConsistencyPtr cfg = CfgMgr::instance().getStagingCfg()->getConsistency();
if (!cfg) {
- isc_throw(Unexpected, "the " << (current ? "current" : "staging")
- << " consistency configuration is null");
+ isc_throw(Unexpected, "the staging consistency configuration is null");
}
auto check = cfg->getExtendedInfoSanityCheck();
bool enabled = getExtendedInfoTablesEnabled();
@@ -3417,7 +3411,6 @@ Memfile_LeaseMgr::buildExtendedInfoTables6Internal(bool update, bool current) {
LOG_DEBUG(dhcpsrv_logger, DHCPSRV_DBG_TRACE,
DHCPSRV_MEMFILE_BEGIN_BUILD_EXTENDED_INFO_TABLES6)
.arg(CfgConsistency::sanityCheckToText(check))
- .arg(update ? " updating in file" : "")
.arg(enabled ? "enabled" : "disabled");
// Clear tables when enabled.
@@ -3428,7 +3421,6 @@ Memfile_LeaseMgr::buildExtendedInfoTables6Internal(bool update, bool current) {
size_t leases = 0;
size_t modified = 0;
- size_t updated = 0;
size_t processed = 0;
for (auto lease : storage6_) {
@@ -3436,10 +3428,6 @@ Memfile_LeaseMgr::buildExtendedInfoTables6Internal(bool update, bool current) {
try {
if (upgradeLease6ExtendedInfo(lease, check)) {
++modified;
- if (update && persistLeases(V6)) {
- lease_file6_->append(*lease);
- ++updated;
- }
}
if (enabled && addExtendedInfo6(lease)) {
++processed;
@@ -3455,10 +3443,7 @@ Memfile_LeaseMgr::buildExtendedInfoTables6Internal(bool update, bool current) {
LOG_INFO(dhcpsrv_logger, DHCPSRV_MEMFILE_BUILD_EXTENDED_INFO_TABLES6)
.arg(leases)
.arg(modified)
- .arg(updated)
.arg(processed);
-
- return (updated);
}
size_t