WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-api

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

To: xen-api@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-API] [PATCH 0 of 2] Make the database upgrade code more flexible
From: David Scott <dave.scott@xxxxxxxxxxxxx>
Date: Tue, 3 Nov 2009 15:56:09 +0000
Delivery-date: Tue, 03 Nov 2009 07:58:00 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-api-request@lists.xensource.com?subject=help>
List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>
List-post: <mailto:xen-api@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
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

<Prev in Thread] Current Thread [Next in Thread>