BIND 10 #2404: MySQL IPv4 lease database access functions

BIND 10 Development do-not-reply at isc.org
Fri Dec 7 12:09:27 UTC 2012


#2404: MySQL IPv4 lease database access functions
-------------------------------------+-------------------------------------
            Reporter:  stephen       |                        Owner:
                Type:  task          |  stephen
            Priority:  medium        |                       Status:
           Component:  dhcpdb        |  reviewing
            Keywords:                |                    Milestone:
           Sensitive:  0             |  Sprint-DHCP-20121213
         Sub-Project:  DHCP          |                   Resolution:
Estimated Difficulty:  0             |                 CVSS Scoring:
         Total Hours:  0             |              Defect Severity:  N/A
                                     |  Feature Depending on Ticket:
                                     |          Add Hours to Ticket:  0
                                     |                    Internal?:  0
-------------------------------------+-------------------------------------
Changes (by tomek):

 * owner:  tomek => stephen


Comment:

 Replying to [comment:11 stephen]:
 > > Feel free to initiate such discussion. If you need more time for this
 than you can dedicate now, please submit a new ticket for that. Currently
 the schema is rather simple, so we can update it manually. But it will get
 much more complicated in the future.
 > Ticket #2543 created for this.
 Thanks.

 > '''src/lib/dhcpsrv/lease_mgr.h'''
 > > The only real difference between class and a struct is that struct
 cannot have private members.
 > Not true - a "struct" can have private members.  The only real
 difference is that elements in a class are "private" by default, whereas
 elements in an struct default to "public".
 I stand corrected.

 > > Ok. I thought that it will be controllable via bind10 config, but
 changing it directly in MySQL is fine as well. So how is it changed? Using
 mysql client? Or in some config file?
 > The settings are stored in a configuration file, but can be set on a
 per-session or per-user basis if required.  See "mysql --help --verbose"
 for more details.
 My version (5.5.24) does not list innodb_flush_log_at_trx_commit in mysql
 --help --verbose. But that's not important for now. Since it is tweakable
 on a per-session or per-user basic, this is perfect for us. I envisage
 that in typical deployment there will be dedicated MySQL user (kea?) for
 us, so it will be possible to set this parameter just once. How it will be
 set is an implementation detail. Personally I think it should be
 controlled from bindctl as they may be other things that change with it
 (e.g. setting this to "raw speed" mode will perhaps omit some sanity
 checks in the code for extra speed).

 > > Yes, you are right. Please remove this call.
 > As this means alterations to a number of files, I've created a separate
 ticket (#2546)
 Ok.

 > > Fair enough. I have either forgotten about getType() method or someone
 else added it. Can I then ask you to update getName() in
 memfile_lease_mgr.h? It's a single line change.
 > As memfile currently doesn't have a backing file, the name returned is
 "memfile".  When we back it up with a file, it should return the name of
 the file.
 So for now it should return empty string or perhaps mem-only or memory.
 The file part of it suggest that there is some file involved, but there is
 none now.

 > > I was thinking about writing Lease6Ptr::operator== that will always
 throw exception to easier trigger cases, when developer wants to compare
 leases, but actually compares pointers to them. But I haven't found a way
 to do that.
 > Providing a specialisation of "boost::shared_ptr<Lease6>::operator==()"
 (within lease_mgr.h) to throw an exception when called is probably the way
 to go.
 Good point. To not forget about this, I've added #2547.

 > Suggested !ChangeLog entry for this change is:
 > {{{
 > xxx.  [func]          stephen
 >       Extend DHCP MySQL backend to handle IPv4 addresses.
 >       (Trac #2404, git xxx)
 > }}}
 Short, simple and adequate.

 Regardless of your choice how to proceed with getName() in memfile, I
 think the code is ready to merge.

-- 
Ticket URL: <http://bind10.isc.org/ticket/2404#comment:12>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development


More information about the bind10-tickets mailing list