[ovs-git] [openvswitch/ovs] 47f724: ovsdb: Update _version more accurately in transact...

GitHub noreply at github.com
Sat Sep 5 00:00:50 UTC 2015


  Branch: refs/heads/branch-2.4
  Home:   https://github.com/openvswitch/ovs
  Commit: 47f7242a17f72bcd7d998ae733aa996e81e01474
      https://github.com/openvswitch/ovs/commit/47f7242a17f72bcd7d998ae733aa996e81e01474
  Author: Ben Pfaff <blp at nicira.com>
  Date:   2015-09-04 (Fri, 04 Sep 2015)

  Changed paths:
    M AUTHORS
    M ovsdb/transaction.c

  Log Message:
  -----------
  ovsdb: Update _version more accurately in transaction commit.

The _version column in each OVSDB row is supposed to be updated whenever
any other column in the row changes.  However, the transaction code was
not careful to do this only when a row actually changed--there were other
cases where a row was considered at transaction commit time and _version
updated even though the row did not actually change.  For example,
ovsdb_txn_adjust_atom_refs() calls find_or_make_txn_row(), which calls
ovsdb_txn_row_modify(), which updates _version, but
ovsdb_txn_adjust_atom_refs() doesn't actually update any data.

One way to fix this would be to carefully consider and adjust all the code
that looks at transaction rows.  However, this seems somewhat error prone
and thus difficult to test.  This commit takes a different approach: it
drops the code that adjusts _version on the fly, instead replacing it by
a final pass over the database at the end of the commit process that checks
for each row whether any columns changed and updates _version at that point
if any did.  That seems pretty foolproof to me.

Reported-by: RishiRaj Maulick <rishi.raj2509 at gmail.com>
Reported-at: http://openvswitch.org/pipermail/dev/2015-August/059439.html
Signed-off-by: Ben Pfaff <blp at nicira.com>
Acked-by: Andy Zhou <azhou at nicira.com>
Tested-by: RishiRaj Maulick <rishi.raj2509 at gmail.com>




More information about the git mailing list