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):
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.
LRP.gateway_chassis is empty
LRP.gateway_chassis contains the reference to the new GWC
This is fixed upstream 2.13 in fc8444fb1d7e113bd6f9954471f80f36e93f2fe7 "python: Send notifications after the transaction ends." and just needs a downstream backport.
Hi. Commit fc8444fb1d7e113bd6f9954471f80f36e93f2fe7 is already part of the
2.13.0-102 build for rhel8 and 2.13.0-85 for rhel7.
It's part of FDP 20.C for RHEL7 and it'll be part of FDP 20.D for RHEL8