2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 06:15:47 +00:00

ovsdb-idl: Don't reparse orphaned rows.

Rows that refer to rows that were inserted in the current IDL run should
only be reparsed if they don't get deleted (become orphan) in the current
IDL run.

Fixes: 7b8aeadd60 ("ovsdb-idl: Re-parse backrefs of inserted rows only once.")
Reported-by: Ilya Maximets <i.maximets@ovn.org>
Signed-off-by: Dumitru Ceara <dceara@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
This commit is contained in:
Dumitru Ceara
2021-11-26 13:26:22 +01:00
committed by Ilya Maximets
parent 149169836d
commit 91e1ff5dde
2 changed files with 32 additions and 1 deletions

View File

@@ -1506,10 +1506,15 @@ ovsdb_idl_reparse_refs_to_inserted(struct ovsdb_idl *db)
struct ovsdb_idl_row *row;
LIST_FOR_EACH_POP (row, reparse_node, &db->rows_to_reparse) {
ovs_list_init(&row->reparse_node);
/* Skip rows that have been deleted in the meantime. */
if (ovsdb_idl_row_is_orphan(row)) {
continue;
}
ovsdb_idl_row_unparse(row);
ovsdb_idl_row_clear_arcs(row, false);
ovsdb_idl_row_parse(row);
ovs_list_init(&row->reparse_node);
}
}

View File

@@ -1540,6 +1540,32 @@ OVSDB_CHECK_IDL([simple idl, initially populated, strong references, conditional
006: done
]])
dnl This test checks that deleting a row that refers to a row that was inserted
dnl in the current IDL run works properly.
OVSDB_CHECK_IDL_TRACK([track, simple idl, initially empty, strong references, insert and delete],
[],
[['["idltest",
{"op": "insert",
"table": "link1",
"uuid-name": "uuid_l1",
"row": {"i": 1, "k": ["named-uuid", "uuid_l1"]}},
{"op": "insert",
"table": "link2",
"row": {"i": 2, "l1": ["set", [["named-uuid", "uuid_l1"]]]}}
]' \
'+["idltest",
{"op": "delete",
"table": "link2",
"where": [["i", "==", 2]]}]'
]],
[[000: empty
001: {"error":null,"result":[{"uuid":["uuid","<0>"]},{"uuid":["uuid","<1>"]}]}
002: {"error":null,"result":[{"count":1}]}
003: table link1: inserted row: i=1 k=1 ka=[] l2= uuid=<0>
003: table link1: updated columns: i k
004: done
]])
OVSDB_CHECK_IDL_TRACK([track, simple idl, initially empty, various ops],
[],
[['["idltest",