From 2e5675612e0ca989d210e496fea152b0776cfbc6 Mon Sep 17 00:00:00 2001 From: abdosi <58047199+abdosi@users.noreply.github.com> Date: Wed, 19 Aug 2020 07:49:11 -0700 Subject: [PATCH] [sonic-swsss] Fix the issue of field "next_hop_ip" not getting updated in state DB in ERSPAN Mirror (#1375) * Fix the issue of field "next_hop_ip" not getting updated in State DB Table MIRROR_SESSION_TABLE Updated test case to check next_hop_ip in state db. Also test case enahanced to see if route change in propgated correctly. Signed-off-by: Abhishek Dosi * Fix test failure and address review comments Signed-off-by: Abhishek Dosi * Fix for Mirror ERSPAN Failure. Issue is we need to wait till we do not get expected (key,value) tuple instead of waiting for just key Danny was able to reproduce the issue on local setup. It is more timing issue where if dvs container is running fast we will not see this issue as value get updated quickly. Signed-off-by: Abhishek Dosi * based on syslog on Jenkin route/nexthop update is taking more then 5 seconds. To fix that yse polling interval of 10 seconds. * Increase timeout to 60 seconds Signed-off-by: Abhishek Dosi * Added Log Signed-off-by: Abhishek Dosi * Revert some of changes done to debug/fix test failure issue as they are resolved with sonic-build-tools fix Signed-off-by: Abhishek Dosi --- orchagent/mirrororch.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/orchagent/mirrororch.cpp b/orchagent/mirrororch.cpp index 0de90a424dd4..dab810f60473 100644 --- a/orchagent/mirrororch.cpp +++ b/orchagent/mirrororch.cpp @@ -949,6 +949,13 @@ void MirrorOrch::updateNextHop(const NextHopUpdate& update) session.nexthopInfo.nexthop = NextHopKey("0.0.0.0", ""); } + // Update State DB Nexthop + setSessionState(name, session, MIRROR_SESSION_NEXT_HOP_IP); + + SWSS_LOG_NOTICE("Updated mirror session state db %s nexthop to %s", + name.c_str(), session.nexthopInfo.nexthop.to_string().c_str()); + + // Resolve the neighbor of the new next hop updateSession(name, session); }