[ovs-git] [openvswitch/ovs] 4ca9dd: test-stream: Silence memory leak report.

Dumitru Ceara noreply at github.com
Fri Apr 9 18:05:10 UTC 2021


  Branch: refs/heads/branch-2.13
  Home:   https://github.com/openvswitch/ovs
  Commit: 4ca9dd87f65a6b748f8c2a3b7f67cb71dee156cb
      https://github.com/openvswitch/ovs/commit/4ca9dd87f65a6b748f8c2a3b7f67cb71dee156cb
  Author: Ilya Maximets <i.maximets at ovn.org>
  Date:   2021-04-09 (Fri, 09 Apr 2021)

  Changed paths:
    M tests/test-stream.c

  Log Message:
  -----------
  test-stream: Silence memory leak report.

AddressSanitizer reports this as a leak.
Let's just free the memory before exiting to avoid the noise.

'stream_close()' doesn't update the pointer, so this will not
change the return value.

Signed-off-by: Ilya Maximets <i.maximets at ovn.org>
Acked-by: Flavio Leitner <fbl at sysclose.org>
Acked-by: Paolo Valerio <pvalerio at redhat.com>


  Commit: 7fca8a3c9410ca50a04578630b93d3dd59287113
      https://github.com/openvswitch/ovs/commit/7fca8a3c9410ca50a04578630b93d3dd59287113
  Author: Ben Pfaff <blp at ovn.org>
  Date:   2021-04-09 (Fri, 09 Apr 2021)

  Changed paths:
    M tests/test-ovsdb.c

  Log Message:
  -----------
  test-ovsdb: Log steps in idl test.

Until now, "test-ovsdb idl" has printed the steps that it goes through
to stdout.  This commit also makes it log the same information.  This
makes it easier to match up the steps with the rest of the log (in
particular with the jsonrpc logging).

Signed-off-by: Ben Pfaff <blp at ovn.org>
Acked-by: Ilya Maximets <i.maximets at ovn.org>
(cherry picked from commit 81f06e2b8f2d46ed40bef33e502f988afc703e64)
Signed-off-by: Dumitru Ceara <dceara at redhat.com>
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>


  Commit: e7d451ab8aef149545144cacacf2b2fa88bc6ac2
      https://github.com/openvswitch/ovs/commit/e7d451ab8aef149545144cacacf2b2fa88bc6ac2
  Author: Dumitru Ceara <dceara at redhat.com>
  Date:   2021-04-09 (Fri, 09 Apr 2021)

  Changed paths:
    M lib/ovsdb-idl.c
    M lib/ovsdb-idl.h
    M tests/ovsdb-cluster.at
    M tests/ovsdb-idl.at
    M tests/test-ovsdb.c
    M tests/test-ovsdb.py

  Log Message:
  -----------
  ovsdb-idl.at: Make test outputs more predictable.

IDL tests need predictable output from test-ovsdb.

This used to be done by first sorting the output of test-ovsdb and then
applying uuidfilt to predictably translate UUIDs.  This was not
reliable enough in case test-ovsdb processes two or more insert/delete
operations in the same iteration because the order of lines in the
output depends on the automatically generated UUID values.

To fix this we change the way test-ovsdb and test-ovsdb.py generate
outputs and prepend the table name and tracking information before
printing the contents of a row.

All existing ovsdb-idl.at and ovsdb-cluster.at tests are updated to
expect the new output format.

Signed-off-by: Dumitru Ceara <dceara at redhat.com>
Acked-by: Han Zhou <hzhou at ovn.org>
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>
(cherry picked from commit 4c0d093b17e8610e92891abad879484b7fbbd716)


  Commit: 6cf6f9d0d3ddc24bba7cc4009a4b7a76f937baa2
      https://github.com/openvswitch/ovs/commit/6cf6f9d0d3ddc24bba7cc4009a4b7a76f937baa2
  Author: Dumitru Ceara <dceara at redhat.com>
  Date:   2021-04-09 (Fri, 09 Apr 2021)

  Changed paths:
    M lib/ovsdb-idl.c
    M tests/ovsdb-idl.at
    M tests/test-ovsdb.c
    M tests/test-ovsdb.py

  Log Message:
  -----------
  ovsdb-idl: Preserve references for deleted rows.

Considering two DB rows, 'a' from table A and 'b' from table B (with
column 'ref_a' a reference to table A):
a = {A._uuid=<U1>}
b = {B._uuid=<U2>, B.ref_a=<U1>}

Assuming both records are present in the IDL client's in-memory view of
the database, depending whether row 'b' is also deleted in the same
transaction or not, deletion of row 'a' should generate the following
tracked changes:

1. only row 'a' is deleted:
- for table A:
  - deleted records: a = {A._uuid=<U1>}
- for table B:
  - updated records: b = {B._uuid=<U2>, B.ref_a=[]}

2. row 'a' and row 'b' are deleted in the same update:
- for table A:
  - deleted records: a = {A._uuid=<U1>}
- for table B:
  - deleted records: b = {B._uuid=<U2>, B.ref_a=<U1>}

To ensure this, we now delay reparsing row backrefs for deleted rows
until all updates in the current run have been processed.

Without this change, in scenario 2 above, the tracked changes for table
B would be:
- deleted records: b = {B._uuid=<U2>, B.ref_a=[]}

In particular, for strong references, row 'a' can never be deleted in
a transaction that happens strictly before row 'b' is deleted.  In some
cases [0] both rows are deleted in the same transaction and having
B.ref_a=[] would violate the integrity of the database from client
perspective.  This would force the client to always validate that
strong reference fields are non-NULL.  This is not really an option
because the information in the original reference is required for
incrementally processing the record deletion.

[0] with ovn-monitor-all=true, the following command triggers a crash
    in ovn-controller because a strong reference field becomes NULL:
    $ ovn-nbctl --wait=hv -- lr-add r -- lrp-add r rp 00:00:00:00:00:01 1.0.0.1/24
    $ ovn-nbctl lr-del r

Reported-at: https://bugzilla.redhat.com/1932642
Fixes: 72aeb243a52a ("ovsdb-idl: Tracking - preserve data for deleted rows.")
Signed-off-by: Dumitru Ceara <dceara at redhat.com>
Acked-by: Han Zhou <hzhou at ovn.org>
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>
(cherry picked from commit 95689f1668181661fd69321aada81b339d1afbf3)


  Commit: d47800bd66b998edfe78b97e21cb0a3da2c78830
      https://github.com/openvswitch/ovs/commit/d47800bd66b998edfe78b97e21cb0a3da2c78830
  Author: Dumitru Ceara <dceara at redhat.com>
  Date:   2021-04-09 (Fri, 09 Apr 2021)

  Changed paths:
    M lib/ovsdb-idl.c
    M tests/ovsdb-idl.at

  Log Message:
  -----------
  ovsdb-idl: Mark arc sources as updated when destination is deleted.

Considering two DB rows, 'a' from table A and 'b' from table B (with
column 'ref_a' a reference to table A):
a = {A._uuid=<U1>}
b = {B._uuid=<U2>, B.ref_a=<U1>}

When the IDL client processes an update that deletes row 'a', row 'b'
is also marked as 'updated' if change tracking is enabled for table B.

Fixes: 102781cc02c6 ("ovsdb-idl: Track changes for table references.")
Signed-off-by: Dumitru Ceara <dceara at redhat.com>
Acked-by: Han Zhou <hzhou at ovn.org>
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>
(cherry picked from commit ac85cdb38c1f33e7952bc4c0347d6c7873fb56a1)


Compare: https://github.com/openvswitch/ovs/compare/68086371c84c...d47800bd66b9


More information about the git mailing list