Skip to content

Commit

Permalink
Issue: Multiple subscription sent for same routing instance from agent.
Browse files Browse the repository at this point in the history
Agent uses two fields stored in DB state of vrf entry to identify if
subscription needs to be send or not. One is the subscription status and
other is force_change. Forced update is done when channel flaps. On flaps
subscription is set to true however it needs to be sent again so the walker
marks forced change to be true and issues a notify.
After doing notify this forced change field is not reset to false.
Because of that any update in VRF results in resending the subscription to CN.

Solution: Reset the force change field after request is processed.

Change-Id: Ib95720fcfe92200f1012762ff68c33d5d376d3bb
Closes-bug: #1429254
  • Loading branch information
manishsing committed Mar 9, 2015
1 parent 217709b commit 706e128
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/vnsw/agent/controller/controller_vrf_export.cc
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ void VrfExport::Notify(AgentXmppChannel *bgp_xmpp_peer,
fabric_vrf_name()) != 0) {
bgp_peer->route_walker()->StartRouteWalk(vrf);
}
state->force_chg_ = false;
}
return;
}
Expand Down
16 changes: 15 additions & 1 deletion src/vnsw/agent/test/test_xmppcs_bcast.cc
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,19 @@ class ControlNodeMockBgpXmppPeer {
}

void ReceiveUpdate(const XmppStanza::XmppMessage *msg) {
if (msg->type == XmppStanza::IQ_STANZA) {
const XmppStanza::XmppMessageIq *iq =
static_cast<const XmppStanza::XmppMessageIq *>(msg);
if (iq->iq_type.compare("set") == 0) {
if (iq->action.compare("subscribe") == 0) {
assert(vrf_subscription_.find(iq->node) ==
vrf_subscription_.end());
vrf_subscription_[iq->node] = true;
} else if (iq->action.compare("unsubscribe") == 0) {
vrf_subscription_.erase(iq->node);
}
}
}
rx_count_++;
}

Expand All @@ -128,6 +141,7 @@ class ControlNodeMockBgpXmppPeer {
private:
XmppChannel *channel_;
size_t rx_count_;
std::map<string, bool> vrf_subscription_;
};


Expand Down Expand Up @@ -531,7 +545,7 @@ class AgentXmppUnitTest : public ::testing::Test {
//Verify mpls table
WAIT_FOR(1000, 1000, (Agent::GetInstance()->mpls_table()->
FindMplsLabel(alloc_label+ 1) == NULL));
WAIT_FOR(1000, 1000, (Agent::GetInstance()->mpls_table()->Size() == 5));
WAIT_FOR(1000, 1000, (Agent::GetInstance()->mpls_table()->Size() == 7));
}

void XmppSubnetTearDown() {
Expand Down

0 comments on commit 706e128

Please sign in to comment.