From 5cd9f691199d2c75dd477f25869bcd3515ea71e7 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Tue, 1 Apr 2014 14:33:24 -0700 Subject: [PATCH] ovsdb-server: Send update for _version for changes due to weak ref removal. 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 Acked-by: Andy Zhou --- ovsdb/transaction.c | 1 + tests/ovsdb-monitor.at | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ovsdb/transaction.c b/ovsdb/transaction.c index 98a7a3fab..be40df9a8 100644 --- a/ovsdb/transaction.c +++ b/ovsdb/transaction.c @@ -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) { diff --git a/tests/ovsdb-monitor.at b/tests/ovsdb-monitor.at index df0157ac9..d24ae9179 100644 --- a/tests/ovsdb-monitor.at +++ b/tests/ovsdb-monitor.at @@ -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>""]" ]]) -- 2.43.0