[kea-dev] update on this ....FRe: thoughts on 3601

Stephen Morris stephen at isc.org
Fri Oct 30 12:42:26 UTC 2015


On 30/10/15 10:57, Thomas Markwalder wrote:

> Currently, it allows one to receive current schema data from
> a file containing prior schema records. For example
> if the current schema is 3.0 and Kea is given a 1.0 lease file:
> 
> 
> 1.0 file --> VersionedCSVFile --> 3.0 data ---> MemfileLeaseMgr
> 
> This will occur automatically whenever MemfileLeaseMgr loads the
> lease file(s).  Currently, this happens inside the MemfileLeaseMgr
> constructor.
> 
> At this point, however, the physical lease file(s) are still 1.0 form.
> The header row has the list of 1.0 columns, the data rows have 1.0 data.
> Any new records written to the file will be in 3.0 form.  Operationally,
> this is fine although not optimal. VersionedCSVFile can load files that
> have mixed generation data.  In fact, such a file could contain 1.0, 2.0,
> and 3.0 records and it will load correctly.  Whenever the file is loaded,
> older schema records are upgraded, current schema records pass thru. Kea
> always gets all records in current schema form.
> 
> The twist is how do we physically convert the files?
> 
> The most obvious answer is to let LFC take care of it.  LFC will convert
> them automatically.  Old schema records go in, current scheme lease files
> are written out.  Of course this only happens if LFC is enabled or they
> run it manually.

Is this really a problem?

AIUI, the idea is that when Kea reads a line from the lease file, the
number of columns determines what memfile schema was used to write that
line. If the number of columns is fewer that that required by the
current version of Kea, defaults are applied to obtain the missing
values. If the number of columns is greater, the additional information
is ignored. (Presumably this could occur if someone upgraded Kea, ran it
for a bit, then reverted back to the previous version.)

If LFC is enabled, then the files will get converted to the new format
when it first runs.  But Kea does not "need" the file to be converted
and will work perfectly well if LFC is disabled.

> 1. We log an error message, stating they should enable LFC or run it
> manually.
> 
> We make sure document by example how to do this for the purposes of
> upgrading.
> (We should probably do this anyway)
> 
> 2. We trigger a one-shot run of LFC when Memfile lease manager starts up
> IF we
> detect an upgrade is needed AND LFC is disabled.

I'd suggest just logging a warning message if we detect a schema upgrade
and LFC is disabled.

Of course, this assumes that any version of Kea will always be able to
read files created with any previous version of Kea.

Stephen


More information about the kea-dev mailing list