]> git.feebdaed.xyz Git - 0xmirror/ovs.git/commit
ovsdb: transaction: Fix logging order of duplicate index rows.
authorIlya Maximets <i.maximets@ovn.org>
Wed, 3 Dec 2025 11:01:05 +0000 (12:01 +0100)
committerIlya Maximets <i.maximets@ovn.org>
Thu, 4 Dec 2025 11:45:38 +0000 (12:45 +0100)
commitfc406ea5dffd709cf2208e012ea6cffc1ea996e0
tree02ea1d43fa6289310131314004fa2444d4099e61
parent0b29edb5cbdcffc60e29b2613aa375c39bbaa8c1
ovsdb: transaction: Fix logging order of duplicate index rows.

The message about conflicting rows is trying to order the two rows
in a consistent manner, so the log messages do not change in tests.
But it fails to do so, because the order of columns in the column
set depends on the order of columns inside the hash map, which
depends on the hash function and the internal implementation details
of the hash map.  This results in random test failures, when two
rows end up in the opposite order.

Uncovered while testing a different hash map implementation, but the
failure is technically possible even without any changes in the code,
e.g., by running on a different CPU architecture or with different
compiler flags.

Fix that by introducing a new function that constructs the column
set with columns in a predictable order and without UUID columns that
have random values in most cases and so not actually comparable.

Fixes: 6910a6e6f25f ("ovsdb: Implement table uniqueness constraints ("indexes").")
Reported-by: Rosemarie O'Riorden <rosemarie@redhat.com>
Acked-by: Eelco Chaudron echaudro@redhat.com
Acked-by: Dumitru Ceara <dceara@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
ovsdb/column.c
ovsdb/column.h
ovsdb/transaction.c