ovsdb: Force strong references to non-root tables to be persistent.
authorBen Pfaff <blp@nicira.com>
Thu, 31 Mar 2011 23:43:43 +0000 (16:43 -0700)
committerBen Pfaff <blp@nicira.com>
Tue, 17 May 2011 20:27:30 +0000 (13:27 -0700)
commit4180463ae926666ca9256d4a02f562d0f566031e
treef53b27296e62ea6d16deb590afde59f004dec069
parent595e12cebbc1181395c6c2248c9b36802f71ca7b
ovsdb: Force strong references to non-root tables to be persistent.

When a strong reference to a non-root table is ephemeral, the database log
can contain inconsistencies.  In particular, if the column in question is
the only reference to a row, then the row will be created in one logged
transaction but the reference to it will not be logged (because it is
ephemeral).  Thus, any later occurrence of the row later in the log (to
modify it, to delete it, or just to reference it) will yield a transaction
error and reading the database will abort at that point.

This commit fixes the problem by forcing any column with a strong reference
to a non-root table to be persistent.

The change to ovsdb_schema_from_json() looks bigger than it really is: it
just swaps the order of two operations on the schema and updates their
comments.  Similarly for the update to ovs.db.DbSchema.__init__().

Bug #5144.
Reported-by: Sujatha Sumanth <ssumanth@nicira.com>
Bug #5149.
Reported-by: Ram Jothikumar <rjothikumar@nicira.com>
ovsdb/SPECS
ovsdb/ovsdb.c
python/ovs/db/schema.py
tests/ovsdb-schema.at