Bug 3041 - Meter and Meter Config messages not sent when controller starts after... 37/22637/2
authorAnil Vishnoi <vishnoianil@gmail.com>
Sun, 7 Jun 2015 11:31:06 +0000 (17:01 +0530)
committerAnil Vishnoi <vishnoianil@gmail.com>
Tue, 16 Jun 2015 13:57:25 +0000 (13:57 +0000)
Openflow plugin explictly sends group/meter features statistics request
after successful switch handshake to the controller. Statistics-manager
receives multipart reply and ignores it, because it only process response
for the request sent by itself. So it does not make sense to send these
request from plugin.
Statistics manager also sends meter/group feature multipart request when
it's get notified that new node is added to the inventory. In case where
it gets the response immdiately from switch, sometime it creates race
condition where statistics manager don't find the transaction-id of the
request in the cache for which it received the response. This race condition
occures  because statistics manager store the key in cache once request send
operation finishes successfully in asyn manner. Processing the group/meter
response for the request send by plugin causing the reordering of the event
so that statistics processing happens before it adds transaction-id to the
cache. This race condition make statistics manager believe that the request
was not send by it and so it does not update the meter statistics capability
of the node and hence it stops sending the meter stats.

Patch 2 : Fixed unit test - plugin don't send meter/group feature request
now, so two less events.
Patch 3 : Fixed integration test for stable/lithium and master

Change-Id: I15fb58b8f9118f94d1a4154a2662972f69f938a0
Signed-off-by: Anil Vishnoi <vishnoianil@gmail.com>
openflowplugin-it/src/test/java/org/opendaylight/openflowplugin/openflow/md/it/OFPluginFlowTest.java
openflowplugin-it/src/test/java/org/opendaylight/openflowplugin/openflow/md/it/ScenarioFactory.java
openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/ConnectionConductorImpl.java
openflowplugin/src/test/java/org/opendaylight/openflowplugin/openflow/md/core/ConnectionConductorImplTest.java

index c91c1374a61df41e95e5984f4b3fd9917a76a181..e5eab9c665394b3cef4ee89d4bcdad6ddefa91e0 100644 (file)
@@ -203,7 +203,7 @@ public class OFPluginFlowTest {
         ScenarioFactory.appendPostHandshakeScenario(handshakeScenario, true);
         WaitForMessageEvent flowModEvent = new WaitForMessageEvent(ByteBufUtils
                 .hexStringToBytes(
-                        "04 0e 00 58 00 00 00 05 00 00 00 00 00 00 00 0a "
+                        "04 0e 00 58 00 00 00 03 00 00 00 00 00 00 00 0a "
                         + "00 00 00 00 00 00 00 0a 00 00 00 00 00 00 80 00 "
                         + "ff ff ff ff ff ff ff ff ff ff ff ff 00 01 00 00 "
                         + "00 01 00 16 80 00 0a 02 08 00 80 00 19 08 0a 00 "
index a6fe35f9bb0629f5fe75d7722f08331a044aa5a7..4f071cf7fd84cb7ec2295d40b1283526e2b5e8d5 100644 (file)
@@ -39,7 +39,7 @@ public abstract class ScenarioFactory {
      * @param switchVersionBitmap
      * @param auxId
      * @param pluginVersionBitmap
-     * @param addSleep if true - then add final sleep {@link #DEFAULT_SCENARIO_SLEEP} 
+     * @param addSleep if true - then add final sleep {@link #DEFAULT_SCENARIO_SLEEP}
      * @return stack filled with Handshake messages
      */
     public static Deque<ClientEvent> createHandshakeScenarioVBM(
@@ -59,14 +59,14 @@ public abstract class ScenarioFactory {
                         + "00 01 02 03 04 05 06 07 " + "00 01 02 03 01 "
                         + Integer.toHexString(auxId)
                         + " 00 00 00 01 02 03 00 01 02 03")));
-        
+
         if (addSleep) {
             addSleep(stack);
         }
-        
+
         return stack;
     }
-    
+
     /**
      * @param stack
      * @param addSleep if true - then add final sleep {@link #DEFAULT_SCENARIO_SLEEP}
@@ -78,21 +78,15 @@ public abstract class ScenarioFactory {
                                   "00 0d 00 00 00 00 00 00"  )));
         stack.addFirst(new WaitForMessageEvent(ByteBufUtils
                 .hexStringToBytes("04 12 00 10 00 00 00 02 "+
-                                  "00 08 00 00 00 00 00 00"  )));
-        stack.addFirst(new WaitForMessageEvent(ByteBufUtils
-                .hexStringToBytes("04 12 00 10 00 00 00 03 "+
-                                  "00 0b 00 00 00 00 00 00"  )));
-        stack.addFirst(new WaitForMessageEvent(ByteBufUtils
-                .hexStringToBytes("04 12 00 10 00 00 00 04 "+
                                   "00 00 00 00 00 00 00 00"  )));
-        
+
         if (addSleep) {
             addSleep(stack);
         }
-        
+
         return stack;
     }
-    
+
     /**
      * @param stack
      */
index 99683bf2c8cacede220b6d46f07ee4ba42a2749d..25d731e9bf2c6cdab400aef08c403f505a676520 100644 (file)
@@ -464,8 +464,6 @@ public class ConnectionConductorImpl implements OpenflowProtocolListener,
         // post-handshake actions
         if (version == OFConstants.OFP_VERSION_1_3) {
             requestPorts();
-            requestGroupFeatures();
-            requestMeterFeatures();
         }
 
         requestDesc();
index 214240aefced081f5bed83d173dfd1a4756a67dd..a2957d687644634705df3d0fb52777d5bdab8c50 100644 (file)
@@ -261,8 +261,6 @@ public class ConnectionConductorImplTest {
         int i = 1;
         eventPlan.add(0, EventFactory.createDefaultWaitForRpcEvent(i++, "multipartRequestInput"));
         eventPlan.add(0, EventFactory.createDefaultWaitForRpcEvent(i++, "multipartRequestInput"));
-        eventPlan.add(0, EventFactory.createDefaultWaitForRpcEvent(i++, "multipartRequestInput"));
-        eventPlan.add(0, EventFactory.createDefaultWaitForRpcEvent(i++, "multipartRequestInput"));
         executeNow();
 
         Assert.assertEquals(ConnectionConductor.CONDUCTOR_STATE.WORKING,
@@ -290,8 +288,6 @@ public class ConnectionConductorImplTest {
         int i = 1;
         eventPlan.add(0, EventFactory.createDefaultWaitForRpcEvent(i++, "multipartRequestInput"));
         eventPlan.add(0, EventFactory.createDefaultWaitForRpcEvent(i++, "multipartRequestInput"));
-        eventPlan.add(0, EventFactory.createDefaultWaitForRpcEvent(i++, "multipartRequestInput"));
-        eventPlan.add(0, EventFactory.createDefaultWaitForRpcEvent(i++, "multipartRequestInput"));
 
         executeNow();