X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=xenserver%2Fetc_init.d_openvswitch;h=73009813476d65c3c07fac29c9c40ba69093984a;hb=f805c4cc6e3de7ecd6de9bae99c0405e84334d1e;hp=13b9d40ad2c45904382e4d9c0d90c56dcb41002d;hpb=289df16d29e963aef8c9df590300add4ab722ac9;p=openvswitch diff --git a/xenserver/etc_init.d_openvswitch b/xenserver/etc_init.d_openvswitch index 13b9d40a..73009813 100755 --- a/xenserver/etc_init.d_openvswitch +++ b/xenserver/etc_init.d_openvswitch @@ -341,7 +341,18 @@ function start { cksum=`$ovsdb_tool db-cksum "$OVSDB_SERVER_DB" | awk '{print $1}'` cp "$OVSDB_SERVER_DB" "$OVSDB_SERVER_DB.backup$version-$cksum" - # Upgrade or downgrade schema and compact database. + # Compact database. This is important if the old schema did not enable + # garbage collection (i.e. if it did not have any tables with "isRoot": + # true) but the new schema does. In that situation the old database + # may contain a transaction that creates a record followed by a + # transaction that creates the first use of the record. Replaying that + # series of transactions against the new database schema (as "convert" + # does) would cause the record to be dropped by the first transaction, + # then the second transaction would cause a referential integrity + # failure (for a strong reference). + $ovsdb_tool -vANY:console:emer compact "$OVSDB_SERVER_DB" + + # Upgrade or downgrade schema. $ovsdb_tool -vANY:console:emer convert "$OVSDB_SERVER_DB" "$VSWITCHD_OVSDB_SCHEMA" fi