[bind10-dev] #1376 will require upgrading sqlite3 database file
Stephen Morris
stephen at isc.org
Fri Nov 18 12:49:54 UTC 2011
On 18/11/2011 06:59, Michal 'vorner' Vaner wrote:
>
> I think we should have a script which would detect and run all upgrade and
> maintenance stuff on the first start, or at last said they need to be run to
> the user. In the case of adding a table, I'd say we can safely just do it (it
> would be reasonably fast and wouldn't broke the database even if the user was to
> downgrade).
It's not quite trouble-free. If we do any change to the database, we
should increment the version number (in the schema_version table). Code
should be checking this version number when it starts up and refusing to
run on a version number mismatch.
So in the general case, adding a table wouldn't necessarily allow the
user to downgrade; it could be that the previous version of the code
would refuse to work with a database having the new version number.
Another problem with automatic upgrade is one of time. On systems with
large amounts of data, a database upgrade could take a significant
amount of time. Users would get very annoyed if they upgraded BIND 10
then, after starting, it did nothing for the next couple of hours
because it was upgrading the database.
So I would say that when BIND 10 is in production, if we update the
database we should provide a conversion script that the user can run,
but we should not update automatically.
However...
For this particular case you're probably right and an automatic update
would work. Although there is a schema_version table in the database,
there appears to be no check on the contents. So just adding a table at
startup should not have adverse effects.
Stephen
More information about the bind10-dev
mailing list