Bug 1928226

Summary: ovn-nbctl fails to delete and add lr-nat in same transaction
Product: Red Hat Enterprise Linux Fast Datapath Reporter: Tim Rozet <trozet>
Component: OVNAssignee: OVN Team <ovnteam>
Status: CLOSED DUPLICATE QA Contact: Jianlin Shi <jishi>
Severity: low Docs Contact:
Priority: unspecified    
Version: RHEL 8.0CC: ctrautma, dcbw
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-04 14:24:27 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 Tim Rozet 2021-02-12 16:49:24 UTC
Description of problem:
Executing a delete and add for lr-nat results in the following:


[root@ovn-control-plane ~]# ovn-nbctl lr-nat-list ovn_cluster_router
TYPE             EXTERNAL_IP        EXTERNAL_PORT    LOGICAL_IP            EXTERNAL_MAC         LOGICAL_PORT
dnat_and_snat    169.254.1.34                        10.244.1.2            ae:f9:70:78:2a:d6    k8s-ovn-control-plane
dnat_and_snat    169.254.2.242                       10.244.2.2            4e:ac:df:e2:48:2e    k8s-ovn-worker


[root@ovn-control-plane ~]# ovn-nbctl lr-nat-del ovn_cluster_router dnat_and_snat 169.254.1.34 -- --may-exist lr-nat-add  ovn_cluster_router dnat_and_snat 169.254.1.34 10.244.1.254 k8s-ovn-control-plane ae:f9:70:78:2a:d6
ovn-nbctl: a NAT with this type (dnat_and_snat) and external_ip (169.254.1.34) already exists

The result is nothing is deleted and re-added. Dumitru described the behavior as:
"So, the problem is like this: if you delete and --may-exist add the same object in the same transaction, the add doesn't happen at all, because the old nat object is still in IDL memory (orphaned) and will be removed when the txn is committed."

Request here is to fix ovn-nbctl to handle this scenario.

Comment 1 Dan Williams 2021-05-04 14:24:27 UTC

*** This bug has been marked as a duplicate of bug 1942707 ***