X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=debian%2Fopenvswitch-switch.init;h=8ea58660657ce099d14a25ca9364f872e3c988b6;hb=0b9275b2c7ed2f88491898345e03618dbfbf4b0f;hp=29c8c655efedaab4b7ac01a6f4c268b91081a76c;hpb=f8186f2c8111c171a26ffded62affb1ac1837e88;p=openvswitch diff --git a/debian/openvswitch-switch.init b/debian/openvswitch-switch.init index 29c8c655..8ea58660 100755 --- a/debian/openvswitch-switch.init +++ b/debian/openvswitch-switch.init @@ -232,6 +232,18 @@ case "$1" in cksum=`ovsdb-tool db-cksum "$conf_file" | awk '{print $1}'` cp "$conf_file" "$conf_file.backup$version-$cksum" + # 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 $conf_file + # Upgrade or downgrade schema and compact database. ovsdb-tool -vANY:console:emer convert $conf_file $schema_file fi @@ -261,7 +273,6 @@ case "$1" in set -- "$@" --log-file=/var/log/openvswitch/ovsdb-server.log set -- "$@" --detach --no-chdir --pidfile $monitor_opt set -- "$@" --remote punix:/var/run/openvswitch/db.sock - set -- "$@" --remote db:Open_vSwitch,managers set -- "$@" --remote db:Open_vSwitch,manager_options set -- "$@" --private-key=db:SSL,private_key set -- "$@" --certificate=db:SSL,certificate