mysql_lease_mgr.h and CURRENT_VERSION_VERSION

Stephen Morris stephen at isc.org
Wed Jan 2 18:17:18 UTC 2013


On 28/12/12 11:57, Tomek Mrugalski wrote:
> On 27.12.2012 21:52, Jeremy C. Reed wrote:
>> src/lib/dhcpsrv/mysql_lease_mgr.h has:
>> 
>> // Define the current database schema values
>> 
>> const uint32_t CURRENT_VERSION_VERSION = 1; const uint32_t
>> CURRENT_VERSION_MINOR = 0;
>> 
>> 
>> Should CURRENT_VERSION_VERSION be called CURRENT_VERSION_MAJOR?
>> (I think "VERSION_VERSION" is confusing or at least redundant.)
> We need to ask Stephen about that. I remember that we had a brief 
> discussion about that. I think the original reason was that
> originally there was one version in one of the DNS modules. Later
> minor version numbering was added to mark backward compatible
> changes. To maintain consistent numbering between old and new
> versions, the version had to be still named version. That automatic
> version comparison was needed for dbutil - a tool that we hope one
> day will also support DHCP.
> 
> That's more or less the rationale here. Stephen will
> clarify/correct me once he gets back.

You are correct.


> I suggested that since DHCP component is brand new, we may do
> things the right way and use major/minor version. I don't know how
> dbutil works and if we even will use it (the alternative would be
> to develop dbutil-like tool dedicated to DHCP maintenance). Anyway,
> let's discuss if we want to keep our decision or revisit it.

As the DNS database schema_version table had columns named "version"
and "minor", I opted to use the same for the DHCP database.  Partly
because of compatibility, but also, as Tomek says, for reuse of dbutil.

In essence, dbutil is a utility into which you put the commands to
update the DNS database schema: it holds the commands to update
version n to n+1, commands to update n+1 to n+2 etc.  When run, it
reads the version of the database then applies the command sets to
bring the database up to the latest version.

dbutil can be used for DHCP, although some changes are required - DNS
currently uses SQLite, but DHCP uses MySQL.  However, a lot of the
code is the same.  My idea is to modify dbutil so that it is a
general-purpose BIND 10 database update utility, able to update any
type of database (SQLite, MySQL etc.) for any component (DHCP, DNS).
It would be easier if the schema_version table in both the DNS and
DHCP databases had identical form.

Stephen




More information about the bind10-dhcp mailing list