[ovs-git] [openvswitch/ovs] 7e25c1: test-stream: Silence memory leak report.

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


  Branch: refs/heads/branch-2.14
  Home:   https://github.com/openvswitch/ovs
  Commit: 7e25c103fe74cf01e9d9f110b803c61dfcc14306
      https://github.com/openvswitch/ovs/commit/7e25c103fe74cf01e9d9f110b803c61dfcc14306
  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: 066bd06fa544ea46864a9bc5ea01a7439df80f88
      https://github.com/openvswitch/ovs/commit/066bd06fa544ea46864a9bc5ea01a7439df80f88
  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: 432805ce88d474bb73856f85167fce3d4f30cea1
      https://github.com/openvswitch/ovs/commit/432805ce88d474bb73856f85167fce3d4f30cea1
  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: a25a4f0be99bf98791340bda3def92b8299ca6e4
      https://github.com/openvswitch/ovs/commit/a25a4f0be99bf98791340bda3def92b8299ca6e4
  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: ecea92969afbf0a1bb44d7bff36bffd32718a29e
      https://github.com/openvswitch/ovs/commit/ecea92969afbf0a1bb44d7bff36bffd32718a29e
  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/2c2aced1a11c...ecea92969afb


More information about the git mailing list