diff --git a/SOURCES/openvswitch-2.17.0.patch b/SOURCES/openvswitch-2.17.0.patch index 21dc077..7d3a472 100644 --- a/SOURCES/openvswitch-2.17.0.patch +++ b/SOURCES/openvswitch-2.17.0.patch @@ -113273,7 +113273,7 @@ index ef7bb4b8ee..c36a140a8e 100644 -#endif } diff --git a/python/ovs/db/idl.py b/python/ovs/db/idl.py -index 4ecdcaa197..64bf8afdcc 100644 +index 4ecdcaa197..e1709cc0d2 100644 --- a/python/ovs/db/idl.py +++ b/python/ovs/db/idl.py @@ -85,9 +85,9 @@ class Monitor(enum.IntEnum): @@ -113513,7 +113513,44 @@ index 4ecdcaa197..64bf8afdcc 100644 monitor_requests[table.name] = [monitor_request] args = [self._db.name, str(self.uuid), monitor_requests] -@@ -1148,13 +1217,6 @@ class Idl(object): +@@ -944,7 +1013,9 @@ class Idl(object): + if not row: + raise error.Error('Modify non-existing row') + ++ del table.rows[uuid] + old_row = self.__apply_diff(table, row, row_update['modify']) ++ table.rows[uuid] = row + return Notice(ROW_UPDATE, row, Row(self, table, uuid, old_row)) + else: + raise error.Error(' unknown operation', +@@ -975,9 +1046,10 @@ class Idl(object): + op = ROW_UPDATE + vlog.warn("cannot add existing row %s to table %s" + % (uuid, table.name)) ++ del table.rows[uuid] ++ + changed |= self.__row_update(table, row, new) +- if op == ROW_CREATE: +- table.rows[uuid] = row ++ table.rows[uuid] = row + if changed: + return Notice(ROW_CREATE, row) + else: +@@ -989,9 +1061,11 @@ class Idl(object): + # XXX rate-limit + vlog.warn("cannot modify missing row %s in table %s" + % (uuid, table.name)) ++ else: ++ del table.rows[uuid] ++ + changed |= self.__row_update(table, row, new) +- if op == ROW_CREATE: +- table.rows[uuid] = row ++ table.rows[uuid] = row + if changed: + return Notice(op, row, Row.from_json(self, table, uuid, old)) + return False +@@ -1148,13 +1222,6 @@ class Idl(object): return True @@ -113527,7 +113564,7 @@ index 4ecdcaa197..64bf8afdcc 100644 def _row_to_uuid(value): if isinstance(value, Row): return value.uuid -@@ -1266,7 +1328,19 @@ class Row(object): +@@ -1266,7 +1333,19 @@ class Row(object): return "{table}({data})".format( table=self._table.name, data=", ".join("{col}={val}".format(col=c, val=getattr(self, c)) @@ -113548,7 +113585,7 @@ index 4ecdcaa197..64bf8afdcc 100644 def __getattr__(self, column_name): assert self._changes is not None -@@ -1309,7 +1383,7 @@ class Row(object): +@@ -1309,7 +1388,7 @@ class Row(object): datum = data.Datum.from_python(column.type, dlist, _row_to_uuid) elif column.type.is_map(): @@ -113557,7 +113594,7 @@ index 4ecdcaa197..64bf8afdcc 100644 if inserts is not None: dmap.update(inserts) if removes is not None: -@@ -1326,7 +1400,7 @@ class Row(object): +@@ -1326,7 +1405,7 @@ class Row(object): else: datum = inserts @@ -113566,7 +113603,7 @@ index 4ecdcaa197..64bf8afdcc 100644 def __setattr__(self, column_name, value): assert self._changes is not None -@@ -1410,7 +1484,7 @@ class Row(object): +@@ -1410,7 +1489,7 @@ class Row(object): if value: try: old_value = data.Datum.to_python(self._data[column_name], @@ -118316,7 +118353,7 @@ index e72bf06069..fd1c7a2395 100644 [{"count":1},{"details":"cannot delete b row <0> because of 2 remaining reference(s)","error":"referential integrity violation"}] [{"count":1}] diff --git a/tests/ovsdb-idl.at b/tests/ovsdb-idl.at -index 62e2b63832..22d4481efb 100644 +index 62e2b63832..ae46786ece 100644 --- a/tests/ovsdb-idl.at +++ b/tests/ovsdb-idl.at @@ -1,17 +1,6 @@ @@ -118411,7 +118448,7 @@ index 62e2b63832..22d4481efb 100644 m4_if([$2], [], [], [AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore])]) AT_CHECK([$PYTHON3 $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema unix:socket $3], -@@ -138,7 +145,7 @@ m4_define([OVSDB_CHECK_IDL_PY], +@@ -138,11 +145,20 @@ m4_define([OVSDB_CHECK_IDL_PY], m4_define([OVSDB_CHECK_IDL_REGISTER_COLUMNS_PY], [AT_SETUP([$1 - Python3 - register_columns]) AT_KEYWORDS([ovsdb server idl positive Python register_columns $5]) @@ -118419,8 +118456,23 @@ index 62e2b63832..22d4481efb 100644 + OVSDB_START_IDLTEST m4_if([$2], [], [], [AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore])]) - AT_CHECK([$PYTHON3 $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema unix:socket ?simple:b,ba,i,ia,r,ra,s,sa,u,ua?simple3:name,uset,uref?simple4:name?simple6:name,weak_ref?link1:i,k,ka,l2?link2:i,l1?singleton:name $3], -@@ -152,7 +159,7 @@ m4_define([OVSDB_CHECK_IDL_REGISTER_COLUMNS_PY], +- AT_CHECK([$PYTHON3 $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema unix:socket ?simple:b,ba,i,ia,r,ra,s,sa,u,ua?simple3:name,uset,uref?simple4:name?simple6:name,weak_ref?link1:i,k,ka,l2?link2:i,l1?singleton:name $3], +- [0], [stdout], [ignore]) ++ m4_define([REGISTER], m4_joinall([?], [], ++ [simple:b,ba,i,ia,r,ra,s,sa,u,ua], ++ [simple3:name,uset,uref], ++ [simple4:name], ++ [simple6:name,weak_ref], ++ [link1:i,k,ka,l2], ++ [link2:i,l1], ++ [indexed:i], ++ [singleton:name])) ++ AT_CHECK([$PYTHON3 $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema \ ++ unix:socket REGISTER $3], [0], [stdout], [ignore]) + AT_CHECK([sort stdout | uuidfilt]m4_if([$6],,, [[| $6]]), + [0], [$4]) + OVSDB_SERVER_SHUTDOWN +@@ -152,7 +168,7 @@ m4_define([OVSDB_CHECK_IDL_REGISTER_COLUMNS_PY], m4_define([OVSDB_CHECK_IDL_TCP_PY], [AT_SETUP([$1 - Python3 - tcp]) AT_KEYWORDS([ovsdb server idl positive Python with tcp socket $5]) @@ -118429,7 +118481,7 @@ index 62e2b63832..22d4481efb 100644 PARSE_LISTENING_PORT([ovsdb-server.log], [TCP_PORT]) m4_if([$2], [], [], -@@ -169,7 +176,7 @@ m4_define([OVSDB_CHECK_IDL_TCP_PY], +@@ -169,7 +185,7 @@ m4_define([OVSDB_CHECK_IDL_TCP_PY], m4_define([OVSDB_CHECK_IDL_TCP_MULTIPLE_REMOTES_PY], [AT_SETUP([$1 - Python3 (multiple remotes) - tcp]) AT_KEYWORDS([ovsdb server idl positive Python with tcp socket $5]) @@ -118438,7 +118490,7 @@ index 62e2b63832..22d4481efb 100644 PARSE_LISTENING_PORT([ovsdb-server.log], [TCP_PORT]) WRONG_PORT_1=$((TCP_PORT + 101)) WRONG_PORT_2=$((TCP_PORT + 102)) -@@ -189,7 +196,7 @@ m4_define([OVSDB_CHECK_IDL_TCP6_PY], +@@ -189,7 +205,7 @@ m4_define([OVSDB_CHECK_IDL_TCP6_PY], AT_SKIP_IF([test "$IS_WIN32" = "yes"]) AT_SKIP_IF([test $HAVE_IPV6 = no]) AT_KEYWORDS([ovsdb server idl positive Python with tcp6 socket $5]) @@ -118447,7 +118499,7 @@ index 62e2b63832..22d4481efb 100644 PARSE_LISTENING_PORT([ovsdb-server.log], [TCP_PORT]) echo "TCP_PORT=$TCP_PORT" -@@ -207,7 +214,7 @@ m4_define([OVSDB_CHECK_IDL_TCP6_MULTIPLE_REMOTES_PY], +@@ -207,7 +223,7 @@ m4_define([OVSDB_CHECK_IDL_TCP6_MULTIPLE_REMOTES_PY], AT_SKIP_IF([test "$IS_WIN32" = "yes"]) AT_SKIP_IF([test $HAVE_IPV6 = no]) AT_KEYWORDS([ovsdb server idl positive Python with tcp6 socket $5]) @@ -118456,7 +118508,7 @@ index 62e2b63832..22d4481efb 100644 PARSE_LISTENING_PORT([ovsdb-server.log], [TCP_PORT]) WRONG_PORT_1=$((TCP_PORT + 101)) WRONG_PORT_2=$((TCP_PORT + 102)) -@@ -272,13 +279,13 @@ m4_define([OVSDB_CHECK_IDL_PASSIVE_TCP_PY], +@@ -272,13 +288,13 @@ m4_define([OVSDB_CHECK_IDL_PASSIVE_TCP_PY], [AT_SETUP([$1 - Python3 - ptcp]) AT_KEYWORDS([ovsdb server idl positive Python with tcp socket $5]) # find free TCP port @@ -118472,7 +118524,7 @@ index 62e2b63832..22d4481efb 100644 AT_CHECK([$PYTHON3 $srcdir/test-ovsdb.py -t10 idl_passive $srcdir/idltest.ovsschema ptcp:127.0.0.1:$TCP_PORT $3], [0], [stdout], [ignore]) AT_CHECK([sort stdout | uuidfilt]m4_if([$6],,, [[| $6]]), -@@ -458,7 +465,7 @@ OVSDB_CHECK_IDL([simple idl, writing via IDL with unicode], +@@ -458,7 +474,7 @@ OVSDB_CHECK_IDL([simple idl, writing via IDL with unicode], m4_define([OVSDB_CHECK_IDL_PY_WITH_EXPOUT], [AT_SETUP([$1 - Python3]) AT_KEYWORDS([ovsdb server idl positive Python $5]) @@ -118481,7 +118533,7 @@ index 62e2b63832..22d4481efb 100644 m4_if([$2], [], [], [AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore])]) AT_CHECK([$PYTHON3 $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema unix:socket $3], -@@ -561,9 +568,9 @@ OVSDB_CHECK_IDL([simple idl, conditional, false condition], +@@ -561,9 +577,9 @@ OVSDB_CHECK_IDL([simple idl, conditional, false condition], "b": true}}]']], [['condition simple []' \ 'condition simple [true]']], @@ -118493,7 +118545,7 @@ index 62e2b63832..22d4481efb 100644 003: table simple: i=1 r=2 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> 004: done ]]) -@@ -577,13 +584,40 @@ OVSDB_CHECK_IDL([simple idl, conditional, true condition], +@@ -577,13 +593,40 @@ OVSDB_CHECK_IDL([simple idl, conditional, true condition], "b": true}}]']], [['condition simple []' \ 'condition simple [true]']], @@ -118536,7 +118588,7 @@ index 62e2b63832..22d4481efb 100644 OVSDB_CHECK_IDL([simple idl, conditional, multiple clauses in condition], [['["idltest", {"op": "insert", -@@ -598,9 +632,9 @@ OVSDB_CHECK_IDL([simple idl, conditional, multiple clauses in condition], +@@ -598,9 +641,9 @@ OVSDB_CHECK_IDL([simple idl, conditional, multiple clauses in condition], "b": true}}]']], [['condition simple []' \ 'condition simple [["i","==",1],["i","==",2]]']], @@ -118548,7 +118600,7 @@ index 62e2b63832..22d4481efb 100644 003: table simple: i=1 r=2 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> 003: table simple: i=2 r=3 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2> 004: done -@@ -615,9 +649,9 @@ OVSDB_CHECK_IDL([simple idl, conditional, modify as insert due to condition], +@@ -615,9 +658,9 @@ OVSDB_CHECK_IDL([simple idl, conditional, modify as insert due to condition], "b": true}}]']], [['condition simple []' \ 'condition simple [["i","==",1]]']], @@ -118560,7 +118612,7 @@ index 62e2b63832..22d4481efb 100644 003: table simple: i=1 r=2 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> 004: done ]]) -@@ -638,11 +672,11 @@ OVSDB_CHECK_IDL([simple idl, conditional, modify as delete due to condition], +@@ -638,11 +681,11 @@ OVSDB_CHECK_IDL([simple idl, conditional, modify as delete due to condition], "row": {"i": 2, "r": 3.0, "b": true}}]']], @@ -118575,7 +118627,7 @@ index 62e2b63832..22d4481efb 100644 005: empty 006: {"error":null,"result":[{"uuid":["uuid","<2>"]}]} 007: table simple: i=2 r=3 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2> -@@ -673,14 +707,16 @@ OVSDB_CHECK_IDL([simple idl, conditional, multiple tables], +@@ -673,14 +716,16 @@ OVSDB_CHECK_IDL([simple idl, conditional, multiple tables], "table": "link2", "row": {"i": 3}, "uuid-name": "row0"}]']], @@ -118596,7 +118648,39 @@ index 62e2b63832..22d4481efb 100644 007: {"error":null,"result":[{"uuid":["uuid","<3>"]}]} 008: table link1: i=0 k=0 ka=[] l2= uuid=<2> 008: table link2: i=3 l1= uuid=<3> -@@ -946,7 +982,7 @@ AT_KEYWORDS([ovsdb server idl positive]) +@@ -688,6 +733,31 @@ OVSDB_CHECK_IDL([simple idl, conditional, multiple tables], + 009: done + ]]) + ++OVSDB_CHECK_IDL([indexed idl, modification and removal], ++ [], ++ [['["idltest", ++ {"op": "insert", ++ "table": "indexed", ++ "row": {"i": 123 }}]' \ ++ '["idltest", ++ {"op": "update", ++ "table": "indexed", ++ "where": [["i", "==", 123]], ++ "row": {"i": 456}}]' \ ++ '["idltest", ++ {"op": "delete", ++ "table": "indexed", ++ "where": [["i", "==", 456]]}]']], ++ [[000: empty ++001: {"error":null,"result":[{"uuid":["uuid","<0>"]}]} ++002: table indexed: i=123 uuid=<0> ++003: {"error":null,"result":[{"count":1}]} ++004: table indexed: i=456 uuid=<0> ++005: {"error":null,"result":[{"count":1}]} ++006: empty ++007: done ++]]) ++ + OVSDB_CHECK_IDL([self-linking idl, consistent ops], + [], + [['["idltest", +@@ -946,7 +1016,7 @@ AT_KEYWORDS([ovsdb server idl positive]) # table link2 and column l2 have been deleted. But the IDL still # expects them to be there, so this test checks that it properly # tolerates them being missing. @@ -118605,7 +118689,7 @@ index 62e2b63832..22d4481efb 100644 AT_CHECK([test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 idl unix:socket ['["idltest", {"op": "insert", "table": "link1", -@@ -1019,7 +1055,7 @@ AT_CLEANUP +@@ -1019,7 +1089,7 @@ AT_CLEANUP m4_define([OVSDB_CHECK_IDL_FETCH_COLUMNS_PY], [AT_SETUP([$1 - Python3 - fetch]) AT_KEYWORDS([ovsdb server idl positive Python increment fetch $6]) @@ -118614,7 +118698,7 @@ index 62e2b63832..22d4481efb 100644 m4_if([$2], [], [], [AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore])]) AT_CHECK([$PYTHON3 $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema unix:socket [$3] $4], -@@ -1063,7 +1099,7 @@ OVSDB_CHECK_IDL_FETCH_COLUMNS([simple idl, initially populated], +@@ -1063,7 +1133,7 @@ OVSDB_CHECK_IDL_FETCH_COLUMNS([simple idl, initially populated], m4_define([OVSDB_CHECK_IDL_WO_MONITOR_COND_PY], [AT_SETUP([$1 - Python3]) AT_KEYWORDS([ovsdb server idl Python monitor $4]) @@ -118623,7 +118707,7 @@ index 62e2b63832..22d4481efb 100644 AT_CHECK([ovs-appctl -t ovsdb-server ovsdb-server/disable-monitor-cond]) AT_CHECK([$PYTHON3 $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema unix:socket $2], [0], [stdout], [ignore]) -@@ -1156,7 +1192,7 @@ OVSDB_CHECK_IDL_WO_MONITOR_COND([simple idl disable monitor-cond], +@@ -1156,7 +1226,7 @@ OVSDB_CHECK_IDL_WO_MONITOR_COND([simple idl disable monitor-cond], m4_define([OVSDB_CHECK_IDL_TRACK_C], [AT_SETUP([$1 - C]) AT_KEYWORDS([ovsdb server idl tracking positive $5]) @@ -118632,7 +118716,41 @@ index 62e2b63832..22d4481efb 100644 m4_if([$2], [], [], [AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore])]) AT_CHECK([test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 -c idl unix:socket $3], -@@ -1237,10 +1273,10 @@ OVSDB_CHECK_IDL_TRACK([track, simple idl, initially populated, orphan weak refer +@@ -1201,6 +1271,33 @@ OVSDB_CHECK_IDL_TRACK([track, simple idl, initially populated], + 003: done + ]]) + ++OVSDB_CHECK_IDL_TRACK([track, indexed idl, modification and removal], ++ [], ++ [['["idltest", ++ {"op": "insert", ++ "table": "indexed", ++ "row": {"i": 123 }}]' \ ++ '["idltest", ++ {"op": "update", ++ "table": "indexed", ++ "where": [["i", "==", 123]], ++ "row": {"i": 456}}]' \ ++ '["idltest", ++ {"op": "delete", ++ "table": "indexed", ++ "where": [["i", "==", 456]]}]']], ++ [[000: empty ++001: {"error":null,"result":[{"uuid":["uuid","<0>"]}]} ++002: table indexed: inserted row: i=123 uuid=<0> ++002: table indexed: updated columns: i ++003: {"error":null,"result":[{"count":1}]} ++004: table indexed: i=456 uuid=<0> ++004: table indexed: updated columns: i ++005: {"error":null,"result":[{"count":1}]} ++006: empty ++007: done ++]]) ++ + dnl This test creates database with weak references and checks that orphan + dnl rows created for weak references are not available for iteration via + dnl list of tracked changes. +@@ -1237,10 +1334,10 @@ OVSDB_CHECK_IDL_TRACK([track, simple idl, initially populated, orphan weak refer {"op": "delete", "table": "simple6", "where": []}]']], @@ -118645,7 +118763,7 @@ index 62e2b63832..22d4481efb 100644 003: table simple6: name=first_row weak_ref=[<1>] uuid=<0> 003: table simple: inserted row: i=0 r=0 b=false s=row1_s u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> 003: table simple: updated columns: s -@@ -1279,19 +1315,19 @@ OVSDB_CHECK_IDL_TRACK([track, simple idl, initially populated, orphan rows, cond +@@ -1279,19 +1376,19 @@ OVSDB_CHECK_IDL_TRACK([track, simple idl, initially populated, orphan rows, cond {"op": "delete", "table": "simple6", "where": []}]']], @@ -118669,7 +118787,7 @@ index 62e2b63832..22d4481efb 100644 007: table simple6: name=first_row weak_ref=[<1>] uuid=<0> 007: table simple: deleted row: i=0 r=0 b=false s=row1_s u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<3> 007: table simple: inserted row: i=0 r=0 b=false s=row0_s u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -@@ -1333,14 +1369,14 @@ OVSDB_CHECK_IDL_TRACK([track, simple idl, initially populated, references, condi +@@ -1333,14 +1430,14 @@ OVSDB_CHECK_IDL_TRACK([track, simple idl, initially populated, references, condi {"op": "delete", "table": "simple6", "where": []}]']], @@ -118687,7 +118805,7 @@ index 62e2b63832..22d4481efb 100644 005: table simple6: name=first_row weak_ref=[<3>] uuid=<0> 005: table simple: deleted row: i=0 r=0 b=false s=row0_s u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> 005: table simple: inserted row: i=1 r=0 b=false s=row1_s u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<3> -@@ -1376,7 +1412,8 @@ OVSDB_CHECK_IDL_TRACK([track, simple idl, initially populated, references, singl +@@ -1376,7 +1473,8 @@ OVSDB_CHECK_IDL_TRACK([track, simple idl, initially populated, references, singl {"op": "insert", "table": "simple", "row": {"s": "row0_s"}}]']], @@ -118697,7 +118815,7 @@ index 62e2b63832..22d4481efb 100644 001: table simple6: inserted row: name=row0_s6 weak_ref=[<0>] uuid=<1> 001: table simple6: updated columns: name weak_ref 001: table simple: inserted row: i=0 r=0 b=false s=row0_s u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<0> -@@ -1392,6 +1429,56 @@ OVSDB_CHECK_IDL_TRACK([track, simple idl, initially populated, references, singl +@@ -1392,6 +1490,56 @@ OVSDB_CHECK_IDL_TRACK([track, simple idl, initially populated, references, singl 006: done ]]) @@ -118754,7 +118872,7 @@ index 62e2b63832..22d4481efb 100644 dnl This test checks that deleting both the destination and source of the dnl reference doesn't remove the reference in the source tracked record. OVSDB_CHECK_IDL_TRACK([track, simple idl, initially populated, weak references, multiple deletes], -@@ -1418,7 +1505,8 @@ OVSDB_CHECK_IDL_TRACK([track, simple idl, initially populated, weak references, +@@ -1418,7 +1566,8 @@ OVSDB_CHECK_IDL_TRACK([track, simple idl, initially populated, weak references, {"op": "insert", "table": "simple", "row": {"s": "row0_s"}}]']], @@ -118764,7 +118882,7 @@ index 62e2b63832..22d4481efb 100644 001: table simple6: inserted row: name=row0_s6 weak_ref=[<0>] uuid=<1> 001: table simple6: updated columns: name weak_ref 001: table simple: inserted row: i=0 r=0 b=false s=row0_s u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<0> -@@ -1458,7 +1546,9 @@ OVSDB_CHECK_IDL_TRACK([track, simple idl, initially populated, strong references +@@ -1458,7 +1607,9 @@ OVSDB_CHECK_IDL_TRACK([track, simple idl, initially populated, strong references {"op": "insert", "table": "simple", "row": {"s": "row0_s"}}]']], @@ -118775,7 +118893,7 @@ index 62e2b63832..22d4481efb 100644 001: table simple3: inserted row: name=row0_s3 uset=[] uref=[<0>] uuid=<1> 001: table simple3: updated columns: name uref 001: table simple4: inserted row: name=row0_s4 uuid=<0> -@@ -1493,12 +1583,14 @@ OVSDB_CHECK_IDL_TRACK([track, simple idl, initially populated, strong references +@@ -1493,12 +1644,14 @@ OVSDB_CHECK_IDL_TRACK([track, simple idl, initially populated, strong references {"op": "insert", "table": "simple", "row": {"s": "row0_s"}}]']], @@ -118792,7 +118910,7 @@ index 62e2b63832..22d4481efb 100644 003: table simple3: name=row0_s3 uset=[] uref=[] uuid=<1> 003: table simple4: deleted row: name=row0_s4 uuid=<0> 004: {"error":null,"result":[{"uuid":["uuid","<2>"]}]} -@@ -1529,10 +1621,12 @@ OVSDB_CHECK_IDL([simple idl, initially populated, strong references, conditional +@@ -1529,10 +1682,12 @@ OVSDB_CHECK_IDL([simple idl, initially populated, strong references, conditional {"op": "insert", "table": "simple", "row": {"s": "row0_s"}}]']], @@ -118807,7 +118925,7 @@ index 62e2b63832..22d4481efb 100644 003: table simple3: name=row0_s3 uset=[] uref=[] uuid=<1> 004: {"error":null,"result":[{"uuid":["uuid","<2>"]}]} 005: table simple3: name=row0_s3 uset=[] uref=[] uuid=<1> -@@ -1650,7 +1744,7 @@ OVSDB_CHECK_IDL_TRACK([track, simple idl, initially empty, various ops], +@@ -1650,7 +1805,7 @@ OVSDB_CHECK_IDL_TRACK([track, simple idl, initially empty, various ops], m4_define([OVSDB_CHECK_IDL_PARTIAL_UPDATE_MAP_COLUMN], [AT_SETUP([$1 - C]) AT_KEYWORDS([ovsdb server idl partial update map column positive $5]) @@ -118816,7 +118934,7 @@ index 62e2b63832..22d4481efb 100644 m4_if([$2], [], [], [AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore])]) AT_CHECK([test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 -c idl-partial-update-map-column unix:socket $3], -@@ -1711,7 +1805,7 @@ OVSDB_CHECK_IDL_PY([partial-map update set refmap idl], +@@ -1711,7 +1866,7 @@ OVSDB_CHECK_IDL_PY([partial-map update set refmap idl], m4_define([OVSDB_CHECK_IDL_PARTIAL_UPDATE_SET_COLUMN], [AT_SETUP([$1 - C]) AT_KEYWORDS([ovsdb server idl partial update set column positive $5]) @@ -118825,7 +118943,44 @@ index 62e2b63832..22d4481efb 100644 m4_if([$2], [], [], [AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore])]) AT_CHECK([test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 -c idl-partial-update-set-column unix:socket $3], -@@ -1900,7 +1994,7 @@ OVSDB_CHECK_IDL_NOTIFY([simple idl verify notify], +@@ -1891,6 +2046,36 @@ OVSDB_CHECK_IDL_NOTIFY([simple idl verify notify], + 015: done + ]]) + ++OVSDB_CHECK_IDL_NOTIFY([indexed idl, modification and removal notify], ++ [['track-notify' \ ++ '["idltest", ++ {"op": "insert", ++ "table": "indexed", ++ "row": {"i": 123 }}]' \ ++ '["idltest", ++ {"op": "update", ++ "table": "indexed", ++ "where": [["i", "==", 123]], ++ "row": {"i": 456}}]' \ ++ '["idltest", ++ {"op": "delete", ++ "table": "indexed", ++ "where": [["i", "==", 456]]}]']], ++ [[000: empty ++000: event:create, row={}, uuid=<0>, updates=None ++000: event:create, row={}, uuid=<1>, updates=None ++001: {"error":null,"result":[{"uuid":["uuid","<2>"]}]} ++002: event:create, row={i=123}, uuid=<2>, updates=None ++002: table indexed: i=123 uuid=<2> ++003: {"error":null,"result":[{"count":1}]} ++004: event:update, row={i=456}, uuid=<2>, updates={i=123} ++004: table indexed: i=456 uuid=<2> ++005: {"error":null,"result":[{"count":1}]} ++006: empty ++006: event:delete, row={i=456}, uuid=<2>, updates=None ++007: done ++]]) ++ + # Tests to verify the functionality of the one column compound index. + # It tests index for one column string and integer indexes. + # The run of test-ovsdb generates the output of the display of data using the different indexes defined in +@@ -1900,7 +2085,7 @@ OVSDB_CHECK_IDL_NOTIFY([simple idl verify notify], m4_define([OVSDB_CHECK_IDL_COMPOUND_INDEX_SINGLE_COLUMN_C], [AT_SETUP([$1 - C]) AT_KEYWORDS([ovsdb server idl compound_index_single_column compound_index positive $5]) @@ -118834,7 +118989,7 @@ index 62e2b63832..22d4481efb 100644 m4_if([$2], [], [], [AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore])]) # Generate the data to be tested. -@@ -2047,7 +2141,7 @@ OVSDB_CHECK_IDL_COMPOUND_INDEX_SINGLE_COLUMN_C([Compound_index, single column te +@@ -2047,7 +2232,7 @@ OVSDB_CHECK_IDL_COMPOUND_INDEX_SINGLE_COLUMN_C([Compound_index, single column te m4_define([OVSDB_CHECK_IDL_COMPOUND_INDEX_DOUBLE_COLUMN_C], [AT_SETUP([$1 - C]) AT_KEYWORDS([ovsdb server idl compound_index_double_column compound_index positive $5]) @@ -118843,7 +118998,7 @@ index 62e2b63832..22d4481efb 100644 m4_if([$2], [], [], [AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore])]) # Generate the data to be tested. -@@ -2186,7 +2280,7 @@ OVSDB_CHECK_IDL_COMPOUND_INDEX_DOUBLE_COLUMN_C([Compound_index, double column te +@@ -2186,7 +2371,7 @@ OVSDB_CHECK_IDL_COMPOUND_INDEX_DOUBLE_COLUMN_C([Compound_index, double column te m4_define([OVSDB_CHECK_IDL_COMPOUND_INDEX_WITH_REF], [AT_SETUP([$1 - C]) AT_KEYWORDS([ovsdb server idl compound_index compound_index_with_ref positive $5]) @@ -118852,7 +119007,7 @@ index 62e2b63832..22d4481efb 100644 m4_if([$2], [], [], [AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore])]) AT_CHECK([test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 -c idl-compound-index-with-ref unix:socket $3], -@@ -2214,7 +2308,7 @@ m4_define([CHECK_STREAM_OPEN_BLOCK], +@@ -2214,7 +2399,7 @@ m4_define([CHECK_STREAM_OPEN_BLOCK], AT_SKIP_IF([test "$3" = "tcp6" && test "$IS_WIN32" = "yes"]) AT_SKIP_IF([test "$3" = "tcp6" && test "$HAVE_IPV6" = "no"]) AT_KEYWORDS([ovsdb server stream open_block $3]) @@ -118861,7 +119016,7 @@ index 62e2b63832..22d4481efb 100644 PARSE_LISTENING_PORT([ovsdb-server.log], [TCP_PORT]) WRONG_PORT=$(($TCP_PORT + 101)) AT_CHECK([$2 tcp:$4:$TCP_PORT], [0], [ignore]) -@@ -2230,6 +2324,23 @@ CHECK_STREAM_OPEN_BLOCK([Python3], [$PYTHON3 $srcdir/test-stream.py], +@@ -2230,6 +2415,23 @@ CHECK_STREAM_OPEN_BLOCK([Python3], [$PYTHON3 $srcdir/test-stream.py], CHECK_STREAM_OPEN_BLOCK([Python3], [$PYTHON3 $srcdir/test-stream.py], [tcp6], [[[::1]]]) @@ -118885,7 +119040,7 @@ index 62e2b63832..22d4481efb 100644 # same as OVSDB_CHECK_IDL but uses Python IDL implementation with tcp # with multiple remotes to assert the idl connects to the leader of the Raft cluster m4_define([OVSDB_CHECK_IDL_LEADER_ONLY_PY], -@@ -2245,10 +2356,11 @@ m4_define([OVSDB_CHECK_IDL_LEADER_ONLY_PY], +@@ -2245,10 +2447,11 @@ m4_define([OVSDB_CHECK_IDL_LEADER_ONLY_PY], pids=$(cat s2.pid s3.pid s1.pid | tr '\n' ',') echo $pids AT_CHECK([$PYTHON3 $srcdir/test-ovsdb.py -t30 idl-cluster $srcdir/idltest.ovsschema $remotes $pids $3], @@ -118898,7 +119053,7 @@ index 62e2b63832..22d4481efb 100644 AT_CLEANUP]) OVSDB_CHECK_IDL_LEADER_ONLY_PY([Check Python IDL connects to leader], 3, ['remote']) -@@ -2291,6 +2403,7 @@ m4_define([OVSDB_CHECK_CLUSTER_IDL_C], +@@ -2291,6 +2494,7 @@ m4_define([OVSDB_CHECK_CLUSTER_IDL_C], AT_CHECK([sort stdout | uuidfilt]m4_if([$7],,, [[| $7]]), [0], [$5]) m4_ifval([$8], [AT_CHECK([grep '$8' stderr], [1])], [], []) @@ -118906,7 +119061,7 @@ index 62e2b63832..22d4481efb 100644 AT_CLEANUP]) # Same as OVSDB_CHECK_CLUSTER_IDL_C but uses the Python IDL implementation. -@@ -2311,6 +2424,7 @@ m4_define([OVSDB_CHECK_CLUSTER_IDL_PY], +@@ -2311,6 +2515,7 @@ m4_define([OVSDB_CHECK_CLUSTER_IDL_PY], AT_CHECK([sort stdout | uuidfilt]m4_if([$7],,, [[| $7]]), [0], [$5]) m4_if([$8], [AT_CHECK([grep '$8' stderr], [1])], [], []) @@ -118914,7 +119069,7 @@ index 62e2b63832..22d4481efb 100644 AT_CLEANUP]) m4_define([OVSDB_CHECK_CLUSTER_IDL], -@@ -2341,11 +2455,11 @@ OVSDB_CHECK_CLUSTER_IDL([simple idl, monitor_cond_since, cluster disconnect], +@@ -2341,11 +2546,11 @@ OVSDB_CHECK_CLUSTER_IDL([simple idl, monitor_cond_since, cluster disconnect], "table": "simple", "where": [["i", "==", 1]], "row": {"r": 2.0 }}]']], @@ -118929,7 +119084,7 @@ index 62e2b63832..22d4481efb 100644 005: reconnect 006: table simple 007: {"error":null,"result":[{"count":1}]} -@@ -2402,7 +2516,7 @@ reconnect.*waiting .* seconds before reconnect) +@@ -2402,7 +2607,7 @@ reconnect.*waiting .* seconds before reconnect) AT_SETUP([idl table and column presence check]) AT_KEYWORDS([ovsdb server idl table column check]) @@ -118938,7 +119093,7 @@ index 62e2b63832..22d4481efb 100644 AT_CHECK(ovsdb-tool create db2 $abs_srcdir/idltest.ovsschema) AT_CHECK(ovsdb-server -vconsole:warn --log-file=ovsdb-server2.log --detach dnl -@@ -2437,3 +2551,182 @@ unix:socket2 remote has col id in table simple7 +@@ -2437,3 +2642,182 @@ unix:socket2 remote has col id in table simple7 OVSDB_SERVER_SHUTDOWN AT_CLEANUP @@ -124236,7 +124391,7 @@ index a38bf9e6df..86a223caff 100644 for (i = 0; i < n_threads; i++) { printf(" %6" PRIu64, thread_working_ms[i]); diff --git a/tests/test-ovsdb.c b/tests/test-ovsdb.c -index ca4e87b811..461b6bc928 100644 +index ca4e87b811..1369071868 100644 --- a/tests/test-ovsdb.c +++ b/tests/test-ovsdb.c @@ -294,11 +294,24 @@ print_and_free_ovsdb_error(struct ovsdb_error *error) @@ -124555,7 +124710,92 @@ index ca4e87b811..461b6bc928 100644 if (terse) { return xasprintf("%03d: table %s", step, row->table->class_->name); -@@ -2541,11 +2606,12 @@ parse_link2_json_clause(struct ovsdb_idl_condition *cond, +@@ -1951,6 +2016,24 @@ print_idl_row_updated_link2(const struct idltest_link2 *l2, int step) + } + } + ++static void ++print_idl_row_updated_indexed(const struct idltest_indexed *ind, int step) ++{ ++ struct ds updates = DS_EMPTY_INITIALIZER; ++ ++ for (size_t i = 0; i < IDLTEST_INDEXED_N_COLUMNS; i++) { ++ if (idltest_indexed_is_updated(ind, i)) { ++ ds_put_format(&updates, " %s", idltest_indexed_columns[i].name); ++ } ++ } ++ if (updates.length) { ++ print_and_log("%03d: table %s: updated columns:%s", ++ step, ind->header_.table->class_->name, ++ ds_cstr(&updates)); ++ ds_destroy(&updates); ++ } ++} ++ + static void + print_idl_row_updated_simple3(const struct idltest_simple3 *s3, int step) + { +@@ -2100,6 +2183,21 @@ print_idl_row_link2(const struct idltest_link2 *l2, int step, bool terse) + print_idl_row_updated_link2(l2, step); + } + ++static void ++print_idl_row_indexed(const struct idltest_indexed *ind, int step, bool terse) ++{ ++ struct ds msg = DS_EMPTY_INITIALIZER; ++ ++ ds_put_format(&msg, "i=%"PRId64, ind->i); ++ ++ char *row_msg = format_idl_row(&ind->header_, step, ds_cstr(&msg), terse); ++ print_and_log("%s", row_msg); ++ ds_destroy(&msg); ++ free(row_msg); ++ ++ print_idl_row_updated_indexed(ind, step); ++} ++ + static void + print_idl_row_simple3(const struct idltest_simple3 *s3, int step, bool terse) + { +@@ -2180,6 +2278,7 @@ print_idl_row_singleton(const struct idltest_singleton *sng, int step, + static void + print_idl(struct ovsdb_idl *idl, int step, bool terse) + { ++ const struct idltest_indexed *ind; + const struct idltest_simple3 *s3; + const struct idltest_simple4 *s4; + const struct idltest_simple6 *s6; +@@ -2213,6 +2312,10 @@ print_idl(struct ovsdb_idl *idl, int step, bool terse) + print_idl_row_simple6(s6, step, terse); + n++; + } ++ IDLTEST_INDEXED_FOR_EACH (ind, idl) { ++ print_idl_row_indexed(ind, step, terse); ++ n++; ++ } + IDLTEST_SINGLETON_FOR_EACH (sng, idl) { + print_idl_row_singleton(sng, step, terse); + n++; +@@ -2225,6 +2328,7 @@ print_idl(struct ovsdb_idl *idl, int step, bool terse) + static void + print_idl_track(struct ovsdb_idl *idl, int step, bool terse) + { ++ const struct idltest_indexed *ind; + const struct idltest_simple3 *s3; + const struct idltest_simple4 *s4; + const struct idltest_simple6 *s6; +@@ -2257,6 +2361,10 @@ print_idl_track(struct ovsdb_idl *idl, int step, bool terse) + print_idl_row_simple6(s6, step, terse); + n++; + } ++ IDLTEST_INDEXED_FOR_EACH (ind, idl) { ++ print_idl_row_indexed(ind, step, terse); ++ n++; ++ } + + if (!n) { + print_and_log("%03d: empty", step); +@@ -2541,11 +2649,12 @@ parse_link2_json_clause(struct ovsdb_idl_condition *cond, } } @@ -124571,7 +124811,7 @@ index ca4e87b811..461b6bc928 100644 for (cmd = strtok_r(commands, ";", &save_ptr1); cmd; cmd = strtok_r(NULL, ";", &save_ptr1)) { -@@ -2596,15 +2662,20 @@ update_conditions(struct ovsdb_idl *idl, char *commands) +@@ -2596,15 +2705,20 @@ update_conditions(struct ovsdb_idl *idl, char *commands) unsigned int seqno = ovsdb_idl_get_condition_seqno(idl); unsigned int next_seqno = ovsdb_idl_set_condition(idl, tc, &cond); if (seqno == next_seqno ) { @@ -124593,7 +124833,7 @@ index ca4e87b811..461b6bc928 100644 } static void -@@ -2612,6 +2683,7 @@ do_idl(struct ovs_cmdl_context *ctx) +@@ -2612,6 +2726,7 @@ do_idl(struct ovs_cmdl_context *ctx) { struct jsonrpc *rpc; struct ovsdb_idl *idl; @@ -124601,7 +124841,7 @@ index ca4e87b811..461b6bc928 100644 unsigned int seqno = 0; struct ovsdb_symbol_table *symtab; size_t n_uuids = 0; -@@ -2647,8 +2719,8 @@ do_idl(struct ovs_cmdl_context *ctx) +@@ -2647,8 +2762,8 @@ do_idl(struct ovs_cmdl_context *ctx) const char remote_s[] = "set-remote "; const char cond_s[] = "condition "; if (ctx->argc > 2 && strstr(ctx->argv[2], cond_s)) { @@ -124612,7 +124852,7 @@ index ca4e87b811..461b6bc928 100644 i = 3; } else { i = 2; -@@ -2667,6 +2739,21 @@ do_idl(struct ovs_cmdl_context *ctx) +@@ -2667,6 +2782,21 @@ do_idl(struct ovs_cmdl_context *ctx) if (*arg == '+') { /* The previous transaction didn't change anything. */ arg++; @@ -124634,7 +124874,7 @@ index ca4e87b811..461b6bc928 100644 } else { /* Wait for update. */ for (;;) { -@@ -2689,6 +2776,13 @@ do_idl(struct ovs_cmdl_context *ctx) +@@ -2689,6 +2819,13 @@ do_idl(struct ovs_cmdl_context *ctx) } else { print_idl(idl, step++, terse); } @@ -124648,7 +124888,7 @@ index ca4e87b811..461b6bc928 100644 } seqno = ovsdb_idl_get_seqno(idl); -@@ -2701,8 +2795,8 @@ do_idl(struct ovs_cmdl_context *ctx) +@@ -2701,8 +2838,8 @@ do_idl(struct ovs_cmdl_context *ctx) arg + strlen(remote_s), ovsdb_idl_is_connected(idl) ? "true" : "false"); } else if (!strncmp(arg, cond_s, strlen(cond_s))) { @@ -124660,7 +124900,7 @@ index ca4e87b811..461b6bc928 100644 idl_set(idl, arg, step++); } else { diff --git a/tests/test-ovsdb.py b/tests/test-ovsdb.py -index 853264f22b..b6144e0d53 100644 +index 853264f22b..956fe376d4 100644 --- a/tests/test-ovsdb.py +++ b/tests/test-ovsdb.py @@ -37,7 +37,7 @@ vlog.init(None) @@ -124672,7 +124912,33 @@ index 853264f22b..b6144e0d53 100644 return json[0] else: return json -@@ -325,9 +325,9 @@ def substitute_uuids(json, symtab): +@@ -228,6 +228,10 @@ def get_link2_table_printable_row(row): + return s + + ++def get_indexed_table_printable_row(row): ++ return "i=%s" % row.i ++ ++ + def get_singleton_table_printable_row(row): + return "name=%s" % row.name + +@@ -307,6 +311,14 @@ def print_idl(idl, step, terse=False): + terse) + n += 1 + ++ if "indexed" in idl.tables: ++ ind = idl.tables["indexed"].rows ++ for row in ind.values(): ++ print_row("indexed", row, step, ++ get_indexed_table_printable_row(row), ++ terse) ++ n += 1 ++ + if "singleton" in idl.tables: + sng = idl.tables["singleton"].rows + for row in sng.values(): +@@ -325,9 +337,9 @@ def substitute_uuids(json, symtab): symbol = symtab.get(json) if symbol: return str(symbol) @@ -124684,7 +124950,7 @@ index 853264f22b..b6144e0d53 100644 d = {} for key, value in json.items(): d[key] = substitute_uuids(value, symtab) -@@ -341,10 +341,10 @@ def parse_uuids(json, symtab): +@@ -341,10 +353,10 @@ def parse_uuids(json, symtab): name = "#%d#" % len(symtab) sys.stderr.write("%s = %s\n" % (name, json)) symtab[name] = json @@ -124697,7 +124963,7 @@ index 853264f22b..b6144e0d53 100644 for value in json.values(): parse_uuids(value, symtab) -@@ -616,18 +616,32 @@ def idl_set(idl, commands, step): +@@ -616,18 +628,32 @@ def idl_set(idl, commands, step): sys.stdout.flush() @@ -124733,7 +124999,17 @@ index 853264f22b..b6144e0d53 100644 def do_idl(schema_file, remote, *commands): -@@ -684,6 +698,7 @@ def do_idl(schema_file, remote, *commands): +@@ -666,6 +692,9 @@ def do_idl(schema_file, remote, *commands): + idl = ovs.db.idl.Idl(remote, schema_helper, leader_only=False) + if "simple3" in idl.tables: + idl.index_create("simple3", "simple3_by_name") ++ if "indexed" in idl.tables: ++ idx = idl.index_create("indexed", "indexed_by_i") ++ idx.add_column("i") + + if commands: + remotes = remote.split(',') +@@ -684,6 +713,7 @@ def do_idl(schema_file, remote, *commands): else: rpc = None @@ -124741,7 +125017,7 @@ index 853264f22b..b6144e0d53 100644 symtab = {} seqno = 0 step = 0 -@@ -707,9 +722,7 @@ def do_idl(schema_file, remote, *commands): +@@ -707,9 +737,7 @@ def do_idl(schema_file, remote, *commands): commands = list(commands) if len(commands) >= 1 and "condition" in commands[0]: @@ -124752,7 +125028,7 @@ index 853264f22b..b6144e0d53 100644 step += 1 for command in commands: -@@ -722,18 +735,35 @@ def do_idl(schema_file, remote, *commands): +@@ -722,18 +750,35 @@ def do_idl(schema_file, remote, *commands): if command.startswith("+"): # The previous transaction didn't change anything. command = command[1:] @@ -124793,7 +125069,7 @@ index 853264f22b..b6144e0d53 100644 seqno = idl.change_seqno -@@ -743,9 +773,7 @@ def do_idl(schema_file, remote, *commands): +@@ -743,9 +788,7 @@ def do_idl(schema_file, remote, *commands): step += 1 idl.force_reconnect() elif "condition" in command: @@ -124804,7 +125080,7 @@ index 853264f22b..b6144e0d53 100644 step += 1 elif not command.startswith("["): idl_set(idl, command, step) -@@ -1012,14 +1040,14 @@ def main(argv): +@@ -1012,14 +1055,14 @@ def main(argv): sys.exit(1) func, n_args = commands[command_name] diff --git a/SPECS/openvswitch2.17.spec b/SPECS/openvswitch2.17.spec index 8ab6f7c..e8b2742 100644 --- a/SPECS/openvswitch2.17.spec +++ b/SPECS/openvswitch2.17.spec @@ -63,7 +63,7 @@ Summary: Open vSwitch Group: System Environment/Daemons daemon/database/utilities URL: http://www.openvswitch.org/ Version: 2.17.0 -Release: 174%{?dist} +Release: 175%{?dist} # Nearly all of openvswitch is ASL 2.0. The bugtool is LGPLv2+, and the # lib/sflow*.[ch] files are SISSL @@ -749,6 +749,12 @@ exit 0 %endif %changelog +* Fri Jun 07 2024 Open vSwitch CI - 2.17.0-175 +- Merging upstream branch-2.17 [RH git: de853f64c1] + Commit list: + f050ccc006 python: idl: Fix index not being updated on row modification. + + * Wed Jun 05 2024 Open vSwitch CI - 2.17.0-174 - Merging upstream branch-2.17 [RH git: 3451661437] Commit list: