Tune eos gossip/notification intervals 73/97973/3
authorTomas Cere <tomas.cere@pantheon.tech>
Tue, 19 Oct 2021 08:54:47 +0000 (10:54 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Thu, 21 Oct 2021 06:02:52 +0000 (08:02 +0200)
Looks like eos gossips take much too long, so lets
lower these so we have faster response times all around.

JIRA: CONTROLLER-2004
Change-Id: I3daf8d207a6b51b16e6b8cb3f7dcefd55e6626cf
Signed-off-by: Tomas Cere <tomas.cere@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
opendaylight/md-sal/eos-dom-akka/pom.xml
opendaylight/md-sal/eos-dom-akka/src/test/java/org/opendaylight/controller/eos/akka/AbstractNativeEosTest.java
opendaylight/md-sal/eos-dom-akka/src/test/java/org/opendaylight/controller/eos/akka/SingleNodeTest.java
opendaylight/md-sal/eos-dom-akka/src/test/java/org/opendaylight/controller/eos/akka/service/ClusterSingletonIntegrationTest.java [moved from opendaylight/md-sal/sal-distributed-eos-native/src/test/java/org/opendaylight/controller/cluster/akka/eos/service/ClusterSingletonIntegrationTest.java with 97% similarity]
opendaylight/md-sal/eos-dom-akka/src/test/resources/application.conf
opendaylight/md-sal/sal-clustering-config/src/main/resources/initial/factory-akka.conf

index 64cdc00..39a57ca 100644 (file)
             <groupId>org.awaitility</groupId>
             <artifactId>awaitility</artifactId>
         </dependency>
+
+        <dependency>
+            <groupId>org.opendaylight.mdsal</groupId>
+            <artifactId>mdsal-singleton-common-api</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.mdsal</groupId>
+            <artifactId>mdsal-singleton-dom-impl</artifactId>
+            <scope>test</scope>
+        </dependency>
     </dependencies>
 </project>
index 576a9c1..5af0e2a 100644 (file)
@@ -288,7 +288,17 @@ public abstract class AbstractNativeEosTest {
     }
 
     protected static void verifyNoNotifications(final MockEntityOwnershipListener listener) {
-        await().pollDelay(2, TimeUnit.SECONDS).until(() -> listener.getChanges().isEmpty());
+        verifyNoNotifications(listener, 2);
+    }
+
+    protected static void verifyNoNotifications(final MockEntityOwnershipListener listener, long delaySeconds) {
+        await().pollDelay(delaySeconds, TimeUnit.SECONDS).until(() -> listener.getChanges().isEmpty());
+    }
+
+    protected static void verifyNoAdditionalNotifications(
+            final MockEntityOwnershipListener listener, long delaySeconds) {
+        listener.resetListener();
+        verifyNoNotifications(listener, delaySeconds);
     }
 
     protected static final class ClusterNode {
@@ -367,6 +377,10 @@ public abstract class AbstractNativeEosTest {
         public List<DOMEntityOwnershipChange> getChanges() {
             return changes;
         }
+
+        public void resetListener() {
+            changes.clear();
+        }
     }
 
     protected static final class MockNativeEntityOwnershipService extends AkkaEntityOwnershipService {
index 4d04530..e497178 100644 (file)
@@ -53,6 +53,7 @@ public class SingleNodeTest extends AbstractNativeEosTest {
 
         registerCandidates(clusterNode, ENTITY_1, "member-2", "member-3");
         verifyListenerState(listener, ENTITY_1, true, true, false);
+        verifyNoAdditionalNotifications(listener, 5);
 
         unregisterCandidates(clusterNode, ENTITY_1, "member-1");
         verifyListenerState(listener, ENTITY_1, true, false, true);
@@ -68,6 +69,7 @@ public class SingleNodeTest extends AbstractNativeEosTest {
 
         final MockEntityOwnershipListener listener = registerListener(clusterNode, ENTITY_1);
         verifyListenerState(listener, ENTITY_1, true, true, false);
+        verifyNoAdditionalNotifications(listener, 5);
 
         unregisterCandidates(clusterNode, ENTITY_1, "member-1", "member-2");
         verifyListenerState(listener, ENTITY_1, true, false, true);
@@ -5,7 +5,7 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-package org.opendaylight.controller.cluster.akka.eos.service;
+package org.opendaylight.controller.eos.akka.service;
 
 import static org.awaitility.Awaitility.await;
 import static org.junit.Assert.assertFalse;
@@ -27,7 +27,7 @@ import org.awaitility.Awaitility;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
-import org.opendaylight.controller.cluster.akka.eos.AbstractNativeEosTest;
+import org.opendaylight.controller.eos.akka.AbstractNativeEosTest;
 import org.opendaylight.mdsal.eos.dom.api.DOMEntityOwnershipService;
 import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonService;
 import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceRegistration;
@@ -40,7 +40,7 @@ public class ClusterSingletonIntegrationTest extends AbstractNativeEosTest {
 
     private static final Logger LOG = LoggerFactory.getLogger(ClusterSingletonIntegrationTest.class);
 
-    private MockNativeEntityOwnershipService node1;
+    private AbstractNativeEosTest.MockNativeEntityOwnershipService node1;
     private MockNativeEntityOwnershipService node2;
     private MockNativeEntityOwnershipService node3;
 
index 71c983a..ff23633 100644 (file)
@@ -20,6 +20,18 @@ akka {
       "member-1"
     ]
     downing-provider-class = "akka.cluster.sbr.SplitBrainResolverProvider"
+
+    distributed-data {
+        # How often the Replicator should send out gossip information.
+        # This value controls how quickly Entity Ownership Service data is replicated
+        # across cluster nodes.
+        gossip-interval = 100 ms
+
+        # How often the subscribers will be notified of changes, if any.
+        # This value controls how quickly Entity Ownership Service decisions are
+        # propagated within a node.
+        notify-subscribers-interval = 20 ms
+      }
   }
 }
 
index ed6c7b9..196517f 100644 (file)
@@ -126,6 +126,18 @@ odl-cluster-data {
       use-dispatcher = cluster-dispatcher
 
       failure-detector.acceptable-heartbeat-pause = 3 s
+
+      distributed-data {
+        # How often the Replicator should send out gossip information.
+        # This value controls how quickly Entity Ownership Service data is replicated
+        # across cluster nodes.
+        gossip-interval = 100 ms
+
+        # How often the subscribers will be notified of changes, if any.
+        # This value controls how quickly Entity Ownership Service decisions are
+        # propagated within a node.
+        notify-subscribers-interval = 20 ms
+      }
     }
 
     persistence {