Fix issue where NodeConnector ADDED events were propagated as NodeConnector CHANGED... 41/5241/6
authorMoiz Raja <moraja@cisco.com>
Tue, 11 Feb 2014 03:23:50 +0000 (19:23 -0800)
committerMoiz Raja <moraja@cisco.com>
Fri, 14 Feb 2014 03:18:52 +0000 (19:18 -0800)
commitd644d63f392a3784586a77329817db462c228b51
tree10cefd8aad4e61830cb54274be6707f513873b68
parent58ae8468ff5296ba1ba701d936e3458d5b8dddac
Fix issue where NodeConnector ADDED events were propagated as NodeConnector CHANGED events

Note that this is an interim fix which will work only in a non-clustered setup

The major part of this fix is coded in InventoryAndReadAdapter. The fix is as follows when a NodeConnectorChanged
event is received by the InventoryAdapter it first checks whether this node connector has ever been seen before by
it. It does this by looking at a Map of Nodes to NodeConnectors that it maintains. If the Node Connector is not found
in the Map then this must be a NodeConnector ADDED notification otherwise it is a NodeConnector CHANGED notification.

This commit also contains some code for what would be the ideal fix - one that would work in a cluster scenario as well
That code is in InventoryNotificationProvider and NodeConnectorDataChangeListener. The fix in there works like this. We set
up a DataChangeListener on the MD-SAL DataProvider Service which would notify us whenever a NodeConnector is added, modified
or removed. When the change event comes in depending on whether the node connector was added or modified the data change
listener fires the ADDED or CHANGED event. This fix is disabled for now till another issue with MD-SAL regarding removal
of nodes on mininet exit (or switch disconnect) is resolved.

There are some other changes in the FlowProgrammerAdapter which basically suppress some error conditions when a flow that is
being removed or modified does not exist in the cache that the FlowProgrammerAdapter maintains to translate between AD-SAL and
MD-SAL flows.

This fix allows pingall to work with upto 32 switches - after that other issues prevent testing with more switches.

Change-Id: Ide2e6e85191856a8c6a9746b2397605905938d56
Signed-off-by: Moiz Raja <moraja@cisco.com>
opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/ComponentActivator.xtend
opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/FlowProgrammerAdapter.xtend
opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/InventoryAndReadAdapter.xtend
opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/InventoryNotificationProvider.java [new file with mode: 0644]
opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/NodeConnectorDataChangeListener.java [new file with mode: 0644]
opendaylight/md-sal/inventory-manager/src/main/java/org/opendaylight/controller/md/inventory/manager/FlowCapableInventoryProvider.xtend