Bug 1956377

Summary: The OVS Python IDL calls notify() before all rows in a tx
Product: Red Hat Enterprise Linux Fast Datapath Reporter: Terry Wilson <twilson>
Component: openvswitch2.13Assignee: Open vSwitch development team <ovs-team>
Status: CLOSED NEXTRELEASE QA Contact: qding
Severity: high Docs Contact:
Priority: unspecified    
Version: FDP 21.CCC: ctrautma, i.maximets, jhsiao, ralongi, tredaelli
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-05-07 09:16:51 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Terry Wilson 2021-05-03 14:54:07 UTC
Description of problem:

When multi-row transaction updates are parsed by the Python IDL, notify() is called on each Row as it is processed. When a row references another row that is created in the same transact, e.g. Logical_Router_Port.gateway_chassis and a new Gateway_Chassis, the notify() on the parent Row can be called before the child row has been processed, notify passes the parent row with the reference column empty. With Python 2.7, which does not maintain dict insertion order, this will always happen with a Logical_Router_Port and Gateway_Chassis because of the hash of those string keys always putting the LRP first. With Python 3, this issue doesn't present but it still leaves things open for race conditions.

Version-Release number of selected component (if applicable):


How reproducible:
100% on Python 2.7

Steps to Reproduce:
1. Create an Idl subclass that defines notify()
2. Create a txn creating a Logical_Router_Port and a Gateway_Chassis, setting the LRP.gateway_chassis to the new GC
3. Commit the txn and see that the LRP passed to notify() has an empty gateway_chassis field.

Actual results:
LRP.gateway_chassis is empty

Expected results:
LRP.gateway_chassis contains the reference to the new GWC


Additional info:
This is fixed upstream 2.13 in fc8444fb1d7e113bd6f9954471f80f36e93f2fe7 "python: Send notifications after the transaction ends." and just needs a downstream backport.

Comment 1 Ilya Maximets 2021-05-03 15:50:57 UTC
Hi. Commit fc8444fb1d7e113bd6f9954471f80f36e93f2fe7 is already part of the
2.13.0-102 build for rhel8 and 2.13.0-85 for rhel7.

Comment 2 Timothy Redaelli 2021-05-07 09:16:51 UTC
It's part of FDP 20.C for RHEL7 and it'll be part of FDP 20.D for RHEL8