From 71265f10db02f8e49375c42e154e70512705aff4 Mon Sep 17 00:00:00 2001 From: Vyshakh Krishnan CH Date: Mon, 28 Nov 2016 13:51:04 +0530 Subject: [PATCH] Bug 7234 : Placeholder for BGP minor fixes Issue 1: Modified BGP-Util MD-SAL read, not to supress the exception. As this exception is used for BGP configuration retry mechanism. Issue 2: BGP stale path timer will be shown as default. Issue 3: BGP replay mechanism: Publishes internal VRF's & prefixes before neighborship configuration. 6windQuagga EOR(End of Rib) marker: EOR Marker sent immediately after the neighborship establishment. So in case of BGP-restart scenario, 6windQuagga sends EOR immediately after the session establishment, in this scenario, the prefixes which are published earlier (before restart) will be purged till CSC replays them. Due to this there will be impact in datapath between local-VM's to external DC-Gwy. Change-Id: I6fababd4f8b5f8a96bc2f1e72fefdaf089f75d50 Signed-off-by: Vyshakh Krishnan CH --- .../bgpmanager/BgpConfigurationManager.java | 15 ++++---- .../netvirt/bgpmanager/BgpUtil.java | 2 +- .../netvirt/bgpmanager/commands/Cache.java | 36 +++++++++---------- 3 files changed, 26 insertions(+), 27 deletions(-) diff --git a/vpnservice/bgpmanager/bgpmanager-impl/src/main/java/org/opendaylight/netvirt/bgpmanager/BgpConfigurationManager.java b/vpnservice/bgpmanager/bgpmanager-impl/src/main/java/org/opendaylight/netvirt/bgpmanager/BgpConfigurationManager.java index 9a3622b106..68e6875d4c 100755 --- a/vpnservice/bgpmanager/bgpmanager-impl/src/main/java/org/opendaylight/netvirt/bgpmanager/BgpConfigurationManager.java +++ b/vpnservice/bgpmanager/bgpmanager-impl/src/main/java/org/opendaylight/netvirt/bgpmanager/BgpConfigurationManager.java @@ -1718,14 +1718,6 @@ public class BgpConfigurationManager { } } - List n = config.getNeighbors(); - if (n != null) { - LOG.error("configuring existing Neighbors present for replay total neighbors {}", n.size()); - replayNbrConfig(n, br); - } else { - LOG.error("no Neighbors present for replay config "); - } - List v = config.getVrfs(); if (v != null) { for (Vrfs vrf : v) { @@ -1757,6 +1749,13 @@ public class BgpConfigurationManager { } } } + List n = config.getNeighbors(); + if (n != null) { + LOG.error("configuring existing Neighbors present for replay total neighbors {}", n.size()); + replayNbrConfig(n, br); + } else { + LOG.error("no Neighbors present for replay config "); + } } } diff --git a/vpnservice/bgpmanager/bgpmanager-impl/src/main/java/org/opendaylight/netvirt/bgpmanager/BgpUtil.java b/vpnservice/bgpmanager/bgpmanager-impl/src/main/java/org/opendaylight/netvirt/bgpmanager/BgpUtil.java index 2599e0a6c7..98faf5af3c 100755 --- a/vpnservice/bgpmanager/bgpmanager-impl/src/main/java/org/opendaylight/netvirt/bgpmanager/BgpUtil.java +++ b/vpnservice/bgpmanager/bgpmanager-impl/src/main/java/org/opendaylight/netvirt/bgpmanager/BgpUtil.java @@ -109,8 +109,8 @@ public class BgpUtil { return (Optional) result.get(); } catch (Exception e) { LOG.error("DataStore read exception {} ", e); + throw e; } - return Optional.absent(); } public static void syncWrite(DataBroker broker, LogicalDatastoreType datastoreType, diff --git a/vpnservice/bgpmanager/bgpmanager-impl/src/main/java/org/opendaylight/netvirt/bgpmanager/commands/Cache.java b/vpnservice/bgpmanager/bgpmanager-impl/src/main/java/org/opendaylight/netvirt/bgpmanager/commands/Cache.java index 71cf7990a1..348185b711 100644 --- a/vpnservice/bgpmanager/bgpmanager-impl/src/main/java/org/opendaylight/netvirt/bgpmanager/commands/Cache.java +++ b/vpnservice/bgpmanager/bgpmanager-impl/src/main/java/org/opendaylight/netvirt/bgpmanager/commands/Cache.java @@ -38,12 +38,12 @@ public class Cache extends OsgiCommandSupport { private String action = null; @Option(name=LST, aliases={"-l"}, - description="list vrfs and/or networks", + description="list vrfs and/or networks", required=false, multiValued=true) private List list = null; - @Option(name=OFL, aliases={"-o"}, - description="output file", + @Option(name=OFL, aliases={"-o"}, + description="output file", required=false, multiValued=false) private String ofile = null; @@ -75,7 +75,7 @@ public class Cache extends OsgiCommandSupport { public Object show() throws Exception { return doExecute(); - } + } @Override protected Object doExecute() throws Exception { @@ -101,13 +101,13 @@ public class Cache extends OsgiCommandSupport { if (list != null) { for (String item : list) { switch (item) { - case "vrfs" : + case "vrfs" : list_vrfs = true; break; - case "networks" : + case "networks" : list_nets = true; break; - default: + default: System.err.println("error: unknown value for "+LST+": "+item); return null; } @@ -116,11 +116,11 @@ public class Cache extends OsgiCommandSupport { // we'd normally read this directly from 'config' but // legacy behaviour forces to check for a connection // that's initiated by default at startup without - // writing to config. + // writing to config. String cHost = Commands.getBgpManager().getConfigHost(); int cPort = Commands.getBgpManager().getConfigPort(); ps.printf("\nConfiguration Server\n\t%s %s\n\t%s %d\n", - HTSTR, cHost, PTSTR, cPort); + HTSTR, cHost, PTSTR, cPort); if (config == null) { return null; } @@ -141,16 +141,16 @@ public class Cache extends OsgiCommandSupport { s = g.getStalepathTime().intValue(); } ps.printf("\nBGP Router\n"); - ps.printf("\t%-15s %d\n\t%-15s %s\n\t%-15s %d\n\t%-15s %s\n", - ASSTR, asNum, RISTR, rid, SPSTR, (s!=0?s:"default"), FBSTR, bit); + ps.printf("\t%-15s %d\n\t%-15s %s\n\t%-15s %s\n\t%-15s %s\n", + ASSTR, asNum, RISTR, rid, SPSTR, (s!=0?Integer.toString(s):"default"), FBSTR, bit); } Logging l = config.getLogging(); if (l != null) { - ps.printf("\t%-15s %s\n\t%-15s %s\n", LFSTR, l.getFile(), + ps.printf("\t%-15s %s\n\t%-15s %s\n", LFSTR, l.getFile(), LLSTR, l.getLevel()); } - + List n = config.getNeighbors(); if (n != null) { ps.printf("\nNeighbors\n"); @@ -169,7 +169,7 @@ public class Cache extends OsgiCommandSupport { List afs = nbr.getAddressFamilies(); if (afs != null) { for (AddressFamilies af : afs) { - ps.printf(" %s", af.getSafi().intValue() == 4 ? + ps.printf(" %s", af.getSafi().intValue() == 4 ? "IPv4-Labeled-Unicast" : "Unknown"); } } @@ -180,20 +180,20 @@ public class Cache extends OsgiCommandSupport { if (list_vrfs) { List v = config.getVrfs(); if (v != null) { - ps.printf("\nVRFs\n"); + ps.printf("\nVRFs\n"); for (Vrfs vrf : v) { ps.printf("\t%s\n",vrf.getRd()); ps.printf("\t\t%s ", IRSTR); - for (String rt : vrf.getImportRts()) + for (String rt : vrf.getImportRts()) ps.printf("%s ", rt); ps.printf("\n\t\t%s ", ERSTR); - for (String rt : vrf.getExportRts()) + for (String rt : vrf.getExportRts()) ps.printf("%s ", rt); ps.printf("\n"); } } } - + if (list_nets) { List ln = config.getNetworks(); if (ln != null) { -- 2.36.6