Commit dd1af78a authored by Marcin Siodelski's avatar Marcin Siodelski
Browse files

[master] Merge branch 'trac5341'

parents 6050fa1a 11408b47
......@@ -352,8 +352,8 @@ be followed by a comma and another object definition.</para>
removes redundant (historical) information from the lease file
and effectively reduces the lease file size. The cleanup process is described
in more detailed fashion further in this section. The default value of the
<command>lfc-interval</command> is <userinput>0</userinput>, which disables
the LFC.</simpara>
<command>lfc-interval</command> is <userinput>3600</userinput>. A value of 0
disables the LFC.</simpara>
</listitem>
</itemizedlist>
......
......@@ -347,8 +347,8 @@ be followed by a comma and another object definition.</para>
removes redundant (historical) information from the lease file
and effectively reduces the lease file size. The cleanup process is described
in more detailed fashion further in this section. The default value of the
<command>lfc-interval</command> is <userinput>0</userinput>, which disables
the LFC.</simpara>
<command>lfc-interval</command> is <userinput>3600</userinput>. A value of 0
disables the LFC.</simpara>
</listitem>
</itemizedlist>
......
......@@ -61,7 +61,8 @@
"lease-database": {
// Memfile is the simplest and easiest backend to use. It's a in-memory
// C++ database that stores its state in CSV file.
"type": "memfile"
"type": "memfile",
"lfc-interval": 3600
},
// Kea allows storing host reservations in a database. If your network is
......
......@@ -53,7 +53,8 @@
// There are dedicated examples for each backend. See Section 8.2.2 "Lease
// Storage" for details.
"lease-database": {
"type": "memfile"
"type": "memfile",
"lfc-interval": 3600
},
// Kea allows storing host reservations in a database. If your network is
......
......@@ -1219,11 +1219,11 @@ Memfile_LeaseMgr::lfcCallback() {
void
Memfile_LeaseMgr::lfcSetup(bool conversion_needed) {
std::string lfc_interval_str = "0";
std::string lfc_interval_str = "3600";
try {
lfc_interval_str = conn_.getParameter("lfc-interval");
} catch (const std::exception&) {
// Ignore and default to 0.
// Ignore and default to 3600.
}
uint32_t lfc_interval = 0;
......
......@@ -188,7 +188,8 @@ public:
std::ostringstream s;
s << "type=memfile " << (u == V4 ? "universe=4 " : "universe=6 ")
<< "name="
<< getLeaseFilePath(u == V4 ? "leasefile4_0.csv" : "leasefile6_0.csv");
<< getLeaseFilePath(u == V4 ? "leasefile4_0.csv" : "leasefile6_0.csv")
<< " lfc-interval=0";
return (s.str());
}
......@@ -426,6 +427,7 @@ TEST_F(MemfileLeaseMgrTest, persistLeases) {
DatabaseConnection::ParameterMap pmap;
pmap["universe"] = "4";
pmap["lfc-interval"] = "0";
// Specify the names of the lease files. Leases will be written.
pmap["name"] = getLeaseFilePath("leasefile4_1.csv");
boost::scoped_ptr<Memfile_LeaseMgr> lease_mgr(new Memfile_LeaseMgr(pmap));
......@@ -1633,6 +1635,7 @@ TEST_F(MemfileLeaseMgrTest, lease4ContainerIndexUpdate) {
pmap["universe"] = "4";
pmap["name"] = leasefile;
pmap["persist"] = "true";
pmap["lfc-interval"] = "0";
srand(seed);
......@@ -1772,6 +1775,7 @@ TEST_F(MemfileLeaseMgrTest, lease6ContainerIndexUpdate) {
pmap["universe"] = "6";
pmap["name"] = leasefile;
pmap["persist"] = "true";
pmap["lfc-interval"] = "0";
srand(seed);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment