Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
The FDP team is no longer accepting new bugs in Bugzilla. Please report your issues under FDP project in Jira. Thanks.

Bug 1914304

Summary: [ovn-controller] Crash when moving container parent port to a different logical switch.
Product: Red Hat Enterprise Linux Fast Datapath Reporter: Dumitru Ceara <dceara>
Component: ovn2.13Assignee: Dumitru Ceara <dceara>
Status: CLOSED ERRATA QA Contact: Jianlin Shi <jishi>
Severity: high Docs Contact:
Priority: high    
Version: FDP 20.HCC: ctrautma, jishi, ralongi
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-03-15 14:36:02 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 Dumitru Ceara 2021-01-08 15:02:42 UTC
Description of problem:

ovn-controller might crash when a logical port that is parent for container (sub)logical ports is moved to a different logical switch.

Version-Release number of selected component (if applicable):
ovn2.13-20.12.0-1.el8fdp

How reproducible:
Always

Steps to Reproduce:
# Create two LSs:
ovn-nbctl ls-add ls1
ovn-nbctl ls-add ls2

# Create another LS for container ports:
ovn-nbctl ls-add ls-foo

# Add a logical port to ls1:
ovn-nbctl lsp-add ls1 lsp

# Add a container subport to lsp:
ovn-nbctl lsp-add ls-foo foo lsp 1

# Bind lsp:
ovs-vsctl add-port br-int lsp -- \
  set interface lsp type=internal -- \
  set interface lsp external_ids:iface-id=lsp

# Wait for ovn-controller to catch up.
ovn-nbctl --wait=hv sync

# Move lsp to ls2
ovn-nbctl lsp-del lsp -- lsp-add ls2 lsp

Actual results:
ovn-controller crashes after the last step above.

Expected results:
ovn-controller should successfully change the port binding.

Additional info:
Upstream fix: https://github.com/ovn-org/ovn/commit/d3245f69dd6ec613ceb193f728946f7e3b9b3de3

Comment 2 Jianlin Shi 2021-01-28 06:19:14 UTC
with reproducer in description, reproduced on 20.12.0-1:

[root@dell-per740-12 bz1914304]# bash -x rep.sh                                                       
+ systemctl start openvswitch
+ systemctl start ovn-northd
+ ovn-nbctl set-connection ptcp:6641                                                                  
+ ovn-sbctl set-connection ptcp:6642                                                                  
+ ovs-vsctl set open . external_ids:system-id=hv1 external_ids:ovn-remote=tcp:1.1.38.25:6642 external_ids:ovn-encap-type=geneve external_ids:ovn-encap-ip=1.1.38.25
+ systemctl restart ovn-controller
+ ps aux
+ grep ovn-controller
openvsw+   33783  0.0  0.0 281824  6624 ?        S<sl 01:14   0:00 ovn-controller unix:/run/openvswitch/db.sock -vconsole:emer -vsyslog:err -vfile:info --user openvswitch:openvswitch --no-chdir --log-file=/var/log/ovn/ovn-controller.log --pidfile=/run/ovn/ovn-controller.pid --detach                       
root       33787  0.0  0.0  12112  1080 pts/0    S+   01:14   0:00 grep ovn-controller                
+ ovn-nbctl ls-add ls1
+ ovn-nbctl ls-add ls2
+ ovn-nbctl ls-add ls-foo
+ ovn-nbctl lsp-add ls1 lsp
+ ovn-nbctl lsp-add ls-foo foo lsp 1                                                                  
+ ovs-vsctl add-port br-int lsp -- set interface lsp type=internal -- set interface lsp external_ids:iface-id=lsp
+ ovn-nbctl --wait=hv sync
+ ovn-nbctl lsp-del lsp -- lsp-add ls2 lsp                                                            
+ ps aux
+ grep ovn-controller
root       33857  0.0  0.0  12112  1092 pts/0    S+   01:14   0:00 grep ovn-controller                
[root@dell-per740-12 bz1914304]# ps aux | grep ovn-controller
openvsw+   33883  0.1  0.0 282620  5752 ?        S<sl 01:14   0:00 ovn-controller unix:/run/openvswitch/db.sock -vconsole:emer -vsyslog:err -vfile:info --user openvswitch:openvswitch --no-chdir --log-file=/var/log/ovn/ovn-controller.log --pidfile=/run/ovn/ovn-controller.pid --detach                       
root       33890  0.0  0.0  12112  1064 pts/0    S+   01:14   0:00 grep --color=auto ovn-controller   

<=== ovn-controller crashed and restarted
[root@dell-per740-12 bz1914304]# rpm -qa | grep ovn2.13
ovn2.13-20.12.0-1.el8fdp.x86_64                                                                       
ovn2.13-host-20.12.0-1.el8fdp.x86_64                                                                  
ovn2.13-central-20.12.0-1.el8fdp.x86_64



Verified on ovn2.13-20.12.0-9:

[root@dell-per740-12 bz1914304]# bash -x rep.sh 
+ systemctl start openvswitch
+ systemctl start ovn-northd
+ ovn-nbctl set-connection ptcp:6641
+ ovn-sbctl set-connection ptcp:6642
+ ovs-vsctl set open . external_ids:system-id=hv1 external_ids:ovn-remote=tcp:1.1.38.25:6642 external_ids:ovn-encap-type=geneve external_ids:ovn-encap-ip=1.1.38.25
+ systemctl restart ovn-controller
+ ps aux
+ grep ovn-controller
openvsw+   35965  0.0  0.0 281844  4616 ?        S<sl 01:18   0:00 ovn-controller unix:/run/openvswitch/db.sock -vconsole:emer -vsyslog:err -vfile:info --user openvswitch:openvswitch --no-chdir --log-file=/var/log/ovn/ovn-controller.log --pidfile=/run/ovn/ovn-controller.pid --detach
root       35969  0.0  0.0  12112  1072 pts/0    S+   01:18   0:00 grep ovn-controller
+ ovn-nbctl ls-add ls1
+ ovn-nbctl ls-add ls2
+ ovn-nbctl ls-add ls-foo
+ ovn-nbctl lsp-add ls1 lsp
+ ovn-nbctl lsp-add ls-foo foo lsp 1
+ ovs-vsctl add-port br-int lsp -- set interface lsp type=internal -- set interface lsp external_ids:iface-id=lsp
+ ovn-nbctl --wait=hv sync
+ ovn-nbctl lsp-del lsp -- lsp-add ls2 lsp
+ ps aux
+ grep ovn-controller
openvsw+   35965  3.0  0.0 283032  6356 ?        S<sl 01:18   0:00 ovn-controller unix:/run/openvswitch/db.sock -vconsole:emer -vsyslog:err -vfile:info --user openvswitch:openvswitch --no-chdir --log-file=/var/log/ovn/ovn-controller.log --pidfile=/run/ovn/ovn-controller.pid --detach
root       36041  0.0  0.0  12112  1072 pts/0    S+   01:18   0:00 grep ovn-controller
[root@dell-per740-12 bz1914304]# ps aux | grep ovn-controller
openvsw+   35965  0.3  0.0 283032  6356 ?        S<sl 01:18   0:00 ovn-controller unix:/run/openvswitch/db.sock -vconsole:emer -vsyslog:err -vfile:info --user openvswitch:openvswitch --no-chdir --log-file=/var/log/ovn/ovn-controller.log --pidfile=/run/ovn/ovn-controller.pid --detach
root       36045  0.0  0.0  12112  1044 pts/0    S+   01:18   0:00 grep --color=auto ovn-controller

<==== no crash

[root@dell-per740-12 bz1914304]# rpm -qa | grep ovn2.13
ovn2.13-20.12.0-9.el8fdp.x86_64
ovn2.13-central-20.12.0-9.el8fdp.x86_64
ovn2.13-host-20.12.0-9.el8fdp.x86_64

Comment 5 Jianlin Shi 2021-02-22 06:37:44 UTC
set VERIFIED per comment 2

Comment 7 errata-xmlrpc 2021-03-15 14:36:02 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 (ovn2.13 bug fix and enhancement update), 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-2021:0836