[ovs-discuss] OVSDB C IDL index problems

Han Zhou zhouhan at gmail.com
Sat Aug 11 04:30:22 UTC 2018


Hi,

I noticed two major issues of OVSDB C IDL index.

1) In current IDL index code it doesn't updated index when handling
    "update2" messages, which is the default case. The consequence
    is that when a row is updated, the index is not updated accordingly,
    and even worse, it causes crash when calling ovsdb_idl_destroy().

I posted a fix for this:
https://patchwork.ozlabs.org/project/openvswitch/list/?series=60372

2) The IDL index is not updated for changes made in current IDL iteration.
It will be updated only after the change is committed and notification of
the change is received from the server. Even worse, crash can happen when
using index after a row is deleted. It can be reproduced with below patch
in the idl test case:

------8><----------------------------------------------><8----------
diff --git a/tests/test-ovsdb.c b/tests/test-ovsdb.c
index de94fd0..d2cbc68 100644
--- a/tests/test-ovsdb.c
+++ b/tests/test-ovsdb.c
@@ -2882,6 +2882,9 @@ test_idl_compound_index_single_column(struct
ovsdb_idl *idl,
      ovs_assert(myRow->i == 4);
      txn = ovsdb_idl_txn_create(idl);
      idltest_simple_delete(myRow);
+
+     myRow = idltest_simple_index_find(i_index, toDelete);
+
      toInsert = idltest_simple_insert(txn);
      idltest_simple_set_i(toInsert, 54);
      idltest_simple_set_s(toInsert, "Lista054");
----------------------------------------------------------------------------
Note: to reproduce this issue it doesn't have to be finding the same key
that has been deleted. It seems simply using the index will trigger the
crash.

I haven't worked on fixing the issue 2) yet.
Ben, in an OVN meeting 2 weeks ago I had briefly mentioned this but I
didn't know about the crash at that time. It seems not a quick fix to me,
and I may not have time for it next week. It would be really helpful if you
or anyone else could help on this. It might lead to serious problems now
that we use indexes a lot in ovn-controller.

Thanks,
Han
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openvswitch.org/pipermail/ovs-discuss/attachments/20180810/e87bfa5e/attachment.html>


More information about the discuss mailing list