Commit 02f31a1262fc has fixed the row references when insertion and
deletion execute in one IDL run. However, we can still hit ovn-controller
crash in pressure test where pb->datapath == NULL. It is triggered by
reference dst deletion in same IDL run:

  idl run:
    update1:
      insert port_binding
      insert datapath_binding
    update2:
      delete datapath_binding
      delete port_binding

Fix it by reparse reference src before dst deletion.

Fixes: 02f31a1262fc ("ovsdb-idl: Preserve references for rows deleted in same 
IDL run as their insertion.")
Signed-off-by: Tao Liu <taoliu...@163.com>
---
 lib/ovsdb-idl.c | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/lib/ovsdb-idl.c b/lib/ovsdb-idl.c
index 634fbb56d..89393b52b 100644
--- a/lib/ovsdb-idl.c
+++ b/lib/ovsdb-idl.c
@@ -2425,11 +2425,25 @@ ovsdb_idl_insert_row(struct ovsdb_idl_row *row, const 
struct shash *data)
 }
 
 static void
-ovsdb_idl_delete_row(struct ovsdb_idl_row *row)
+reparse_row(struct ovsdb_idl_row *row)
 {
-    /* If row has to be reparsed, reparse it before it's deleted. */
     if (!ovs_list_is_empty(&row->reparse_node)) {
         ovsdb_idl_row_parse(row);
+        ovs_list_remove(&row->reparse_node);
+        ovs_list_init(&row->reparse_node);
+    }
+}
+
+static void
+ovsdb_idl_delete_row(struct ovsdb_idl_row *row)
+{
+    struct ovsdb_idl_arc *arc;
+
+    /* If row has to be reparsed, reparse it before it's deleted. */
+    reparse_row(row);
+    /* Reparse src before dst is deleted */
+    LIST_FOR_EACH (arc, dst_node, &row->dst_arcs) {
+        reparse_row(arc->src);
     }
     ovsdb_idl_remove_from_indexes(row);
     ovsdb_idl_row_clear_arcs(row, true);
-- 
2.31.1

_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to