Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 17 additions & 8 deletions orchagent/mirrororch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,17 +113,17 @@ bool MirrorOrch::bake()
}
}

if (!active)
if (active)
{
continue;
}
SWSS_LOG_NOTICE("Found mirror session %s active before warm reboot",
key.c_str());

SWSS_LOG_NOTICE("Found mirror session %s active before warm reboot",
key.c_str());
// Recover saved active session's monitor port
m_recoverySessionMap.emplace(
key, monitor_port + state_db_key_delimiter + next_hop_ip);
}

// Recover saved active session's monitor port
m_recoverySessionMap.emplace(
key, monitor_port + state_db_key_delimiter + next_hop_ip);
removeSessionState(key);
}

return Orch::bake();
Expand Down Expand Up @@ -382,6 +382,8 @@ void MirrorOrch::deleteEntry(const string& name)
m_policerOrch->decreaseRefCount(session.policer);
}

removeSessionState(name);

m_syncdMirrors.erase(sessionIter);

SWSS_LOG_NOTICE("Removed mirror session %s", name.c_str());
Expand Down Expand Up @@ -436,6 +438,13 @@ void MirrorOrch::setSessionState(const string& name, const MirrorEntry& session,
m_mirrorTable.set(name, fvVector);
}

void MirrorOrch::removeSessionState(const string& name)
{
SWSS_LOG_ENTER();

m_mirrorTable.del(name);
}

bool MirrorOrch::getNeighborInfo(const string& name, MirrorEntry& session)
{
SWSS_LOG_ENTER();
Expand Down
2 changes: 2 additions & 0 deletions orchagent/mirrororch.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ class MirrorOrch : public Orch, public Observer, public Subject
* attr is the field name will be stored, if empty then all fields will be stored
*/
void setSessionState(const std::string& name, const MirrorEntry& session, const std::string& attr = "");
void removeSessionState(const std::string& name);

bool getNeighborInfo(const string&, MirrorEntry&);

void updateNextHop(const NextHopUpdate&);
Expand Down