Bug 1669306

Summary: Add ability to run read-only Commands outside a transaction
Product: Red Hat OpenStack Reporter: Terry Wilson <twilson>
Component: python-ovsdbappAssignee: Terry Wilson <twilson>
Status: CLOSED ERRATA QA Contact: Roman Safronov <rsafrono>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 14.0 (Rocky)CC: dalvarez, ekuris, jamsmith, lmartins, nchandek, rheslop, rsafrono, twilson
Target Milestone: z2Keywords: Reopened, Triaged, ZStream
Target Release: 14.0 (Rocky)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-ovsdbapp-0.12.3-1.el7ost Doc Type: Bug Fix
Doc Text:
This update fixes a networking-ovn bug that prevented load balancer traffic from being distributed even when distributed virtual routing (DVR) was enabled. Prior to this update, auto-nested transactions failed when the return value of one command was used as input to another. Commands that returned values used in other commands that were bundled into the same auto-nested transaction could not return their values until after the transaction completed. This caused the networking-ovn load balancer problem. Because most commands that return values are read-only, it is not necessary to initiate a transaction, because the data is already in memory. With this update, the read-only commands are run outside of a transaction, resolving the problem.
Story Points: ---
Clone Of:
: 1674560 1714911 (view as bug list) Environment:
Last Closed: 2019-05-29 15:58:01 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:
Bug Depends On:    
Bug Blocks: 1649334, 1674560, 1705056, 1714911    

Description Terry Wilson 2019-01-24 21:56:35 UTC
networking-ovn uses nested transactions, and some of the code for DVR relies on the result of a call to lsp_get_up.execute() inside a nested transaction. The result doesn't get set until the parent transaction is complete, so execute() returns None which prevents the external_mac from being set, so traffic ends up being sent to the controller instead of the through the compute node.

Although this isn't technically a bug in ovsdbapp, the behavior is not documented at all and is surprising. Luckily, it is very easy to safely work around in ovsdbapp and should lead to increased performance as well. All that needs to be done is to allow Command.execute() to run read-only Commands outside of a transaction. This is safe because execute() is designed for single-command transactions and read-only Commands only access the in-memory copy of the database.

Comment 5 Terry Wilson 2019-02-21 14:28:38 UTC
ovsbapp rocky release 0.12.3 contains these changes.

Comment 16 Roman Safronov 2019-04-16 12:57:37 UTC
Verified on 14.0-RHEL-7/2019-04-12.1  with  python2-ovsdbapp-0.12.3-1.el7ost.noarch

Verified that DVR functionality works properly.
Scenario:
Created a router, connected it to the external network.
Created internal network, subnet, connected network to the router.
Created a security group with icp/ssh allowed.
Created a VM with the security rules applied, connected to the internal network.
Created a floating IP for the VM.
Verified that traffic from the VM goes out via compute node.
Also verified that when VM does not have a FIP traffic from it goes out via controller node which is master chassis for the router.

Comment 17 Roman Safronov 2019-04-30 08:49:26 UTC
*** Bug 1668746 has been marked as a duplicate of this bug. ***

Comment 19 errata-xmlrpc 2019-04-30 17:47:41 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2019:0944