BIND 10 #3360: memfile: implement file support
BIND 10 Development
do-not-reply at isc.org
Wed Mar 26 08:46:23 UTC 2014
#3360: memfile: implement file support
-------------------------------------+-------------------------------------
Reporter: tomek | Owner:
Type: enhancement | UnAssigned
Priority: medium | Status:
Component: dhcpdb | reviewing
Keywords: | Milestone: DHCP-
Sensitive: 0 | Kea0.9-alpha
Sub-Project: DHCP | Resolution:
Estimated Difficulty: 5 | CVSS Scoring:
Total Hours: 2 | Defect Severity: N/A
| Feature Depending on Ticket:
| Add Hours to Ticket: 2
| Internal?: 0
-------------------------------------+-------------------------------------
Changes (by marcin):
* owner: marcin => UnAssigned
* status: assigned => reviewing
Comment:
The code is ready for review. I apologize for the size of the code. There
are tickets like this one when you realize the amount of work required
when you're half way through the work already.
The key changes:
- There is a new utility class: CSVFile which provides generic methods to
access CSV files - write/read etc.
- There are two new classes which derive from CSVFile which implement
specialized CSV file parsers for DHCPv4 and DHCPv6 leases respectively.
- Memfile backend is now configurable to store (or not store) leases in a
CSV file. The location of the file can also be customized.
- DHCPv4 and DHCPv6 configuration has been extended with the parameter
which controls the lease file locations and whether or not use this file.
- Database access parser injects the universe (V4 or V6) to the backend
configuration. This is ignored by MySQL backend (as it uses common
database for v4 and v6) but is required for Memfile so as it knows that it
should open lease file for v4 but not for v6, and vice-versa.
Things out of scope of this ticket
- Lease file compression - each change in the lease yields one more lease
record being appended to the file. If renewals (or any other changes) are
frequent enough, the size of the file may grow significantly. It would be
possible to compress the file and simply keep the latest lease for a
particular client. Currently there are no means to trigger that behavior.
- Perhaps we could allow any order for CSV file columns.
- Existing lease files should be compatible with new files. For example,
if we add the new value to the lease file, the updated parser should be
still able to operate on old lease files (without this value)
- When reading the lease from the file fails, we may choose to continue
reading subsequent leases. On the other hand, if this is an IO error
reading subsequent leases may be endless or at least may cause unexpected
results. Perhaps some form of error counter could be introduced, to leave
when number of errors is greater than X.
- There is number of unit tests failing (disabled) for Memfile backend.
The reasons for failures are known in most cases. I fixed one of the
failing tests, but other I left unchanged as they are more involved, i.e.
require implementation of some unimplemented functions.
Proposed !ChangeLog:
{{{
XXX. [func]* marcin
libdhcpsrv: the Memfile lease storage backend now writes leases
into
CSV file. Configuration parsers for b10-dhcp4 and b10-dhcp6 use
the
new configuration parameters to control the location of the lease
file. It is possible to disable lease writes to disk using
configuration for testing purposes.
(Trac #3360, git abc)
}}}
--
Ticket URL: <http://bind10.isc.org/ticket/3360#comment:4>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development
More information about the bind10-tickets
mailing list