BIND 10 #2342: MySQL IPv6 lease database access functions
BIND 10 Development
do-not-reply at isc.org
Tue Oct 30 12:55:54 UTC 2012
#2342: MySQL IPv6 lease database access functions
-------------------------------------+-------------------------------------
Reporter: | Owner: tomek
stephen | Status: reviewing
Type: task | Milestone: Sprint-
Priority: | DHCP-20121101
medium | Resolution:
Component: | Sensitive: 0
dhcpdb | Sub-Project: DHCP
Keywords: | Estimated Difficulty: 0
Defect Severity: N/A | Total Hours: 0
Feature Depending on Ticket: |
Add Hours to Ticket: 0 |
Internal?: 0 |
-------------------------------------+-------------------------------------
Changes (by stephen):
* owner: stephen => tomek
Comment:
'''configure.ac'''
>> To avoid confusion, I've also removed the MySQL listing from the final
report.
> Why? Printing out MySQL parameters is very useful, we just need to make
them as DHCP-only. It makes sense to also...
I wanted to avoid over-complicating configure.ac, but it turned out not to
be too much trouble to add this. It only appears if the --with-dhcp-mysql
has been specified, to avoid confusing people building DNS.
''' dhcpdb_create.mysql'''
> Our customer asks to do two conflicting things at the same time: keep
portability and be as efficient as possible (with implies using MySQL
specific things).
I think the aim is that we don't use anything in MySQL that we can't
duplicate elsewhere. Here, all we are talking about is the format by
which the data is stored in the database. That can vary between
databases: providing we write the database layer appropriately, the code
will work on any database. However, if we were to rely on stored
procedures, we would have difficultly with something like SQLite3 which
doesn't have that feature.
'''lease_mgr.h'''
>>> Please do not use defines with two leading underscores. These are
reserved for compiler. LEASE_MGR_H will just fine instead.
>> Unfortunately that is used elsewhere in BIND 10 - see the .h files in
other directories.
> Mistakes made elsewhere does not warrant creating new mistakes. Double
underscore defines are reserved for compiler's internal use ...
Good point. Double underscores removed.
'''lease_mgr.cc'''
> There are 11 includes in lease_mgr.cc. I seriously doubt we need them
all, especially that we are not doing anything fancy there.
Turns out that all but lease_mgr.h can be removed. Done.
'''mysql_lease_mgr_unittest.cc'''
> Ok, there's one more issue: BasicLease6 test started failing for me.
That appears to be down to overflows when adding a large number of seconds
to the cltt field - the time can go beyond 2038. Ticket #2413 has been
created for that. In the meanwhile, the tests deliberately don't cause an
overflow and a TODO has been added to the code.
'''General'''
The code now has the basic add/get/update lease6 capability. Variants of
these are defined using fields other than the address as the key.
However, if this is enough for now, I suggest we merge the current ticket
and create a new ticket for the remainder.
If you agree, the suggested !ChangeLog entry is:
{{{
nnn. [func] stephen
Add initial version of a MySQL backend for the DHCP code. (This
is enabled by specifying --with-dhcp-mysql on the "configure"
command line.) The backend implements the basic IPv6 lease access
functions - add lease, get lease, delete lease, update lease.
(Trac #2342, git xxx)
}}}
--
Ticket URL: <http://bind10.isc.org/ticket/2342#comment:16>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development
More information about the bind10-tickets
mailing list