NAT not working after Replay-Based-Upgrade 26/83226/2
authorChetan Arakere Gowdru <chetan.arakere@altencalsoftlabs.com>
Wed, 24 Jul 2019 09:06:28 +0000 (14:36 +0530)
committerFaseela K <faseela.k@ericsson.com>
Wed, 31 Jul 2019 05:48:53 +0000 (05:48 +0000)
Description: we noticed that the SNAT flows 26->46, 36->46
flows are missing when RBU is perfomed.

Root cause : The flows are actually installed by iterating over the
DPNs retrieved from router-dpn-list, but as this is an operational
DS and is empty initially while doing RBU, the flows installation code is not hit

Solution: As we already have the NAPT switch ID, install the flows
without interating over the router-dpn-list.

Issue: NETVIRT-1617

Change-Id: Ie3b027356f754830e1cfd37d6c2daffdbf9bfa94
Signed-off-by: Chetan Arakere Gowdru <chetan.arakere@altencalsoftlabs.com>
natservice/impl/src/main/java/org/opendaylight/netvirt/natservice/internal/ExternalRoutersListener.java

index bda6a115249de94509b3a91f2f9289027b33bff9..800e90498c3bd1b2cd62ec84fe44c4f6bf59ca8f 100644 (file)
@@ -312,6 +312,7 @@ public class ExternalRoutersListener extends AsyncDataTreeChangeListenerBase<Rou
         } else {
             // write metadata and punt
             installOutboundMissEntry(routerName, routerId, primarySwitchId, confTx);
+            handlePrimaryNaptSwitch(primarySwitchId, routerName, routerId, confTx);
             // Now install entries in SNAT tables to point to Primary for each router
             List<BigInteger> switches = naptSwitchSelector.getDpnsForVpn(routerName);
             for (BigInteger dpnId : switches) {
@@ -319,9 +320,6 @@ public class ExternalRoutersListener extends AsyncDataTreeChangeListenerBase<Rou
                 if (!dpnId.equals(primarySwitchId)) {
                     LOG.debug("handleEnableSnat : Handle Ordinary switch");
                     handleSwitches(dpnId, routerName, routerId, primarySwitchId);
-                } else {
-                    LOG.debug("handleEnableSnat : Handle NAPT switch");
-                    handlePrimaryNaptSwitch(dpnId, routerName, routerId, confTx);
                 }
             }
         }