ovsdb-server: Send update for _version for changes due to weak ref removal.
authorBen Pfaff <blp@nicira.com>
Tue, 1 Apr 2014 21:33:24 +0000 (14:33 -0700)
committerBen Pfaff <blp@nicira.com>
Thu, 3 Apr 2014 14:53:30 +0000 (07:53 -0700)
When a row was deleted, and that caused the transaction manager to remove
a remaining weak reference to the row, and no other change had been made
to the row in that transaction, and a client was monitoring modifications
of the _version column in the row, then the monitor update for the column
did not include the old contents of the _version column, even though it
should have.  This commit fixes the problem.

Probably most clients only look at the new value of the column, if they
monitor _version at all, and this bug is really old, so it's probably
not a serious bug.

Found by inspection.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
ovsdb/transaction.c
tests/ovsdb-monitor.at

index 98a7a3f..be40df9 100644 (file)
@@ -533,6 +533,7 @@ assess_weak_refs(struct ovsdb_txn *txn, struct ovsdb_txn_row *txn_row)
         }
 
         if (datum->n != orig_n) {
+            bitmap_set1(txn_row->changed, OVSDB_COL_VERSION);
             bitmap_set1(txn_row->changed, column->index);
             ovsdb_datum_sort_assert(datum, column->type.key.type);
             if (datum->n < column->type.n_min) {
index df0157a..d24ae91 100644 (file)
@@ -213,7 +213,7 @@ OVSDB_CHECK_MONITOR([monitor weak reference change],
 
 row,action,a,a2a,a2a1,a2b,_version
 <0>,delete,0,"[""set"",[]]","[""uuid"",""<0>""]","[""uuid"",""<1>""]","[""uuid"",""<2>""]"
-<3>,old,,"[""uuid"",""<0>""]",,,
+<3>,old,,"[""uuid"",""<0>""]",,,"[""uuid"",""<4>""]"
 ,new,1,"[""set"",[]]","[""uuid"",""<3>""]","[""uuid"",""<1>""]","[""uuid"",""<5>""]"
 ]])