ovsdb-idl: Fix atomicity of writes that don't change a column's value.
authorBen Pfaff <blp@nicira.com>
Fri, 1 Apr 2011 17:50:52 +0000 (10:50 -0700)
committerBen Pfaff <blp@nicira.com>
Fri, 29 Apr 2011 21:31:50 +0000 (14:31 -0700)
commit95a224c5f4ea3558f67c9f9f28e6e8309d8b8c9a
tree253b5ca8764d0ff7843db62937194bd9b4148fc3
parentcb447687e9c37bc5ecf4bddc2a2c2e744becc16d
ovsdb-idl: Fix atomicity of writes that don't change a column's value.

The existing ovsdb_idl_txn_commit() drops any writes that don't change a
column's value from what was last reported by the database.  But this isn't
a valid optimization, because it breaks the atomicity of transactions.
Suppose columns A and B initially have values 1 and 2.  Client 1 writes
value 1 to both columns in one transaction.  Client 2 writes value 2 to
both columns in another transaction.  The only possible valid results for
any serial ordering of transactions are 1,1 or 2,2.  But if both clients
drop writes to columns that they have not modified, then 2,1 also becomes
possible (because client 1 just writes to B and client 2 just writes to A).

However, for write-only columns we can optimize this out because the IDL
can assume it is the only client writing to a column.

Found by inspection.
lib/ovsdb-idl.c