NETVIRT-1709: Unblock the netvirt CSIT NAT exception 79/92279/3
authorKarthikeyan Krishnan <karthikeyangceb007@gmail.com>
Sun, 13 Sep 2020 13:49:09 +0000 (19:19 +0530)
committerKarthikeyan Krishnan <karthikeyangceb007@gmail.com>
Mon, 14 Sep 2020 04:33:50 +0000 (04:33 +0000)
Issue:
======
https://logs.opendaylight.org/releng/vex-yul-odl-jenkins-1/netvirt-csit-1node-0cmb-1ctl-2cmp-openstack-rocky-dcgw-aluminium/199/robot-plugin/log_full.html.gz

[{'warnerr_list': [1], 'lines': ['2020-09-12T11:48:59,484 | ERROR |
NeutronPortChangeListener-0 | NeutronPortChangeListener | 360 -
org.opendaylight.netvirt.neutronvpn-impl - 0.11.0 | Thread terminated due
to uncaught exception: NeutronPortChangeListener-0',
'java.lang.IllegalArgumentException: Multiple entries with same key:
RouterIdsKey{_routerId=Uuid{_value=d2509c08-51eb-42c3-b80d-1da4abada791}}=RouterIds{_routerId=Uuid{_value=d2509c08-51eb-42c3-b80d-1da4abada791},
augmentation=[]} and
RouterIdsKey{_routerId=Uuid{_value=d2509c08-51eb-42c3-b80d-1da4abada791}}=RouterIds{getRouterId=Uuid{_value=d2509c08-51eb-42c3-b80d-1da4abada791},
augmentation=[]}. To index multiple values under a key, use
Multimaps.index.', '\tat
com.google.common.collect.Maps.uniqueIndex(Maps.java:1338)
~[bundleFile:?]', '\tat
com.google.common.collect.Maps.uniqueIndex(Maps.java:1293)
~[bundleFile:?]', '\tat
org.opendaylight.yangtools.yang.binding.CodeHelpers.compatMap(CodeHelpers.java:296)
~[bundleFile:?]', '\tat

Solution:
=========
Have added the check in vpnMaps DS update method call
before update the router details to the vpnMaps DS to
avoid the existing routerId information again.

JIRA: NETVIRT-1709

Signed-off-by: Karthikeyan Krishnan <karthikeyangceb007@gmail.com>
Change-Id: Ie795bcb2eaa30aa9ec71e5c7052c12b714865e1c

neutronvpn/impl/src/main/java/org/opendaylight/netvirt/neutronvpn/NeutronvpnManager.java

index b44bef074ad84cc8e000fe5bf66e8f61d6f5e6a0..a105aa44c62ce7aae62c633e1aefbb93eb0b19fd 100644 (file)
@@ -692,7 +692,12 @@ public class NeutronvpnManager implements NeutronvpnService, AutoCloseable, Even
                 if (rtrIds == null) {
                     rtrIds = Collections.singletonList(vpnRouterId);
                 } else {
-                    rtrIds.add(vpnRouterId);
+                    //Add vpnRouterId to rtrIds list only if update routerId is not existing in the VpnMap already
+                    for (RouterIds routerId: rtrIds) {
+                        if (!Objects.equals(routerId, vpnRouterId)) {
+                            rtrIds.add(vpnRouterId);
+                        }
+                    }
                 }
                 builder.setRouterIds(rtrIds);
             }