Skip to content

Commit

Permalink
Merge "Fix ToR agent crash for duplicate VxLAN-ID"
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed Jan 22, 2016
2 parents c1a6f4e + c1cfe79 commit 2195e6c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,17 @@ KSyncEntry *LogicalSwitchEntry::UnresolvedReference() {
// while creating stale entry we should not wait for physical
// switch object since it will not be available till config
// comes up

// for stale entry we should always be able to acquire vxlan id
assert(res_vxlan_id_.AcquireVxLanId((uint32_t)vxlan_id_));
// However in certain cases, where OVSDB database is already
// in a state where two Logical switch entries exists with
// same VxLAN ID, we need to recover by deleting the entry
// from OVSDB database
bool ret = res_vxlan_id_.AcquireVxLanId((uint32_t)vxlan_id_);
if (!ret) {
SendTrace(DUP_TUNNEL_KEY_ADD);
}

return NULL;
}

Expand Down Expand Up @@ -363,6 +372,9 @@ void LogicalSwitchEntry::SendTrace(Trace event) const {
case DEL_ACK:
info.set_op("Delete Received");
break;
case DUP_TUNNEL_KEY_ADD:
info.set_op("Add Request with Duplicate tunnel key");
break;
default:
info.set_op("unknown");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ class LogicalSwitchEntry : public OvsdbDBEntry {
DEL_REQ,
ADD_ACK,
DEL_ACK,
DUP_TUNNEL_KEY_ADD,
};
LogicalSwitchEntry(OvsdbDBObject *table, const std::string &name);
LogicalSwitchEntry(OvsdbDBObject *table, const LogicalSwitchEntry *key);
Expand Down

0 comments on commit 2195e6c

Please sign in to comment.