[ovs-git] [openvswitch/ovs] bf3ef6: Handle refTable values with setkey()

otherwiseguy noreply at github.com
Wed Mar 17 12:16:22 UTC 2021


  Branch: refs/heads/branch-2.11
  Home:   https://github.com/openvswitch/ovs
  Commit: bf3ef6a869a4fbecf64378ef290e4732edd1b61d
      https://github.com/openvswitch/ovs/commit/bf3ef6a869a4fbecf64378ef290e4732edd1b61d
  Author: Terry Wilson <twilson at redhat.com>
  Date:   2021-03-16 (Tue, 16 Mar 2021)

  Changed paths:
    M python/ovs/db/idl.py
    M tests/idltest.ovsschema
    M tests/ovsdb-idl.at
    M tests/test-ovsdb.py

  Log Message:
  -----------
  Handle refTable values with setkey()

For columns like QoS.queues where we have a map containing refTable
values, assigning w/ __setattr__ e.g. qos.queues={1: $queue_row}
works, but using using qos.setkey('queues', 1, $queue_row) results
in an Exception. The opdat argument can essentially just be the
JSON representation of the map column instead of trying to build
it.

Signed-off-by: Terry Wilson <twilson at redhat.com>
Signed-off-by: Ben Pfaff <blp at ovn.org>
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>


  Commit: 8710c3e5cefe499eeb2a1b29d47bdaaac5282b7c
      https://github.com/openvswitch/ovs/commit/8710c3e5cefe499eeb2a1b29d47bdaaac5282b7c
  Author: Terry Wilson <twilson at redhat.com>
  Date:   2021-03-17 (Wed, 17 Mar 2021)

  Changed paths:
    M python/ovs/db/idl.py
    M tests/ovsdb-idl.at
    M tests/test-ovsdb.py

  Log Message:
  -----------
  python: Send notifications after the transaction ends.

The Python IDL notification mechanism was sending a notification
for each processed update in a transaction as it was processed.
This causes issues with multi-row changes that contain references
to each other.

For example, if a Logical_Router_Port is created along with a
Gateway_Chassis, and the LRP.gateway_chassis set to that GC, then
when the notify() passes the CREATE event for the LRP, the GC will
not yet have been processed, so __getattr__ when _uuid_to_row fails
to find the GC, will return the default value for LRP.gateway_chassis
which is [].

This patch has the process_update methods return the notifications
that would be produced when a row changes, so they can be queued
and sent after all rows have been processed.

Fixes: d7d417fcddf9 ("Allow subclasses of Idl to define a notification hook")
Signed-off-by: Terry Wilson <twilson at redhat.com>
Acked-by: Brian Haley <haleyb.dev at gmail.com>
Acked-by: Dumitru Ceara <dceara at redhat.com>
Tested-by: Flavio Fernandes <flavio at flaviof.com>
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>


Compare: https://github.com/openvswitch/ovs/compare/e9ad1da4f4d8...8710c3e5cefe


More information about the git mailing list