Skip to content

Commit

Permalink
Ignore duplicate deletes in FlowStatsCollector module.
Browse files Browse the repository at this point in the history
In some transient cases it is possible that two flows with same flow Key
exists in two different partitions. In this scenario, FlowStatsCollector module
can receive duplicate deletes. For now, the FlowStatsCollector module will ignore
duplicate deletes and this scenario will be handled later in FlowStatsCollector by
changing the key from FlowKey to FlowUUID.

Also print partition-id in Flow trace messages.

Change-Id: I79988347a2c7294215e63e950ef871e25a126b3c
Closes-Bug: #1543411
  • Loading branch information
ashoksr committed Feb 15, 2016
1 parent 50d09f2 commit 8248229
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/vnsw/agent/pkt/flow_entry.cc
Expand Up @@ -1867,6 +1867,9 @@ void FlowEntry::FillFlowInfo(FlowInfo &info) {
info.set_smac(data_.smac.ToString());
info.set_dmac(data_.dmac.ToString());
info.set_drop_reason(FlowEntry::DropReasonStr(data_.drop_reason));
if (flow_table_) {
info.set_table_id(flow_table_->table_index());
}
}

static void SetAclListAceId(const AclDBEntry *acl,
Expand Down
1 change: 1 addition & 0 deletions src/vnsw/agent/pkt/pkt.sandesh
Expand Up @@ -239,6 +239,7 @@ struct FlowInfo {
37: optional u64 dip_upper;
38: optional u64 dip_lower;
43: string drop_reason;
44: u16 table_id;
}

/**
Expand Down
8 changes: 6 additions & 2 deletions src/vnsw/agent/vrouter/flow_stats/flow_stats_collector.cc
Expand Up @@ -800,8 +800,12 @@ bool FlowStatsCollector::RequestHandler(boost::shared_ptr<FlowExportReq> req) {
/* Fetch the update stats and export the flow with teardown_time */
FlowExportInfo *info = FindFlowExportInfo(req->key());
if (!info) {
/* Do not expect duplicate deletes */
assert(0);
/* Ignore duplicate deletes for NOW. When two flow-entries point
* to same flow-key (because entries are in different partition),
* we can get duplicate deletes */
/* TODO: change the flow_tree_ key of FlowStatsCollector from
* FlowKey to Flow UUID */
break;
}
/* While updating stats for evicted flows, we set the teardown_time
* and export the flow. So delete handling for evicted flows need not
Expand Down

0 comments on commit 8248229

Please sign in to comment.