[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-API] [PATCH 0 of 2] Make the database upgrade code more flexible



Make the database upgrade code simpler and more flexible.

Previously the upgrade code was brittle: it only supported upgrades between 
named releases; other upgrade attempts resulted in annoying schema_mismatch 
errors.
The old code is also unnecessarily complicated: it carefully saves the new 
database with a fresh filename and restarts, picking the new file up on the 
next restart

The new code attempts to be more flexible. Database upgrades have two 
components:
1. automatic stuff like adding new fields to tables or new tables to the 
database
2. custom upgrade rules.
Both (1) and (2) are attempted on every master xapi start so no more 
schema_mismatch error. For (2) each upgrade rule has a version; it will only be 
applied if the schema version loaded from disk is <= the version in the rule. 
Also xapi nolonger restarts after upgrading the database-- since the cache is 
populated and ready normal startup can continue.

Signed-off-by: David Scott <dave.scott@xxxxxxxxxxxxx>

4 files changed, 114 insertions(+), 133 deletions(-)
ocaml/database/db_cache.ml       |   72 ++++++----------
ocaml/database/db_connections.ml |    1 
ocaml/database/db_upgrade.ml     |  167 +++++++++++++++++---------------------
ocaml/idl/datamodel.ml           |    7 +

_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.