Switch to Akka Artery 09/95409/8
authorKostiantyn Nosach <kostiantyn.nosach@pantheon.tech>
Thu, 4 Mar 2021 11:15:32 +0000 (13:15 +0200)
committerRobert Varga <nite@hq.sk>
Wed, 5 May 2021 13:57:37 +0000 (13:57 +0000)
The migration away from legacy akka remoting to artery tcp.

JIRA: CONTROLLER-1968
Change-Id: Iac1a0186292eb5a303cf075e540f3f6c8c09a932
Signed-off-by: Kostiantyn Nosach <kostiantyn.nosach@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/common/actor/QuarantinedMonitorActor.java
opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/common/actor/QuarantinedMonitorActorTest.java
opendaylight/md-sal/sal-clustering-config/src/main/resources/initial/akka.conf
opendaylight/md-sal/sal-clustering-config/src/main/resources/initial/factory-akka.conf
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/shardmanager/ShardPeerAddressResolverTest.java

index ff8bfc8..dfafb82 100644 (file)
@@ -14,7 +14,7 @@ import akka.actor.UntypedAbstractActor;
 import akka.japi.Effect;
 import akka.remote.AssociationErrorEvent;
 import akka.remote.RemotingLifecycleEvent;
-import akka.remote.ThisActorSystemQuarantinedEvent;
+import akka.remote.artery.ThisActorSystemQuarantinedEvent;
 import java.util.HashSet;
 import java.util.Set;
 import org.slf4j.Logger;
index fd223e2..897cb61 100644 (file)
@@ -18,7 +18,8 @@ import akka.event.Logging;
 import akka.japi.Effect;
 import akka.remote.AssociationErrorEvent;
 import akka.remote.InvalidAssociation;
-import akka.remote.ThisActorSystemQuarantinedEvent;
+import akka.remote.UniqueAddress;
+import akka.remote.artery.ThisActorSystemQuarantinedEvent;
 import akka.testkit.javadsl.TestKit;
 import org.junit.After;
 import org.junit.Before;
@@ -54,7 +55,9 @@ public class QuarantinedMonitorActorTest {
     public void testOnReceiveQuarantined() throws Exception {
         final Throwable t = new RuntimeException("Remote has quarantined this system");
         final InvalidAssociation cause = InvalidAssociation.apply(LOCAL, REMOTE, t, Option.apply(null));
-        final ThisActorSystemQuarantinedEvent event = new ThisActorSystemQuarantinedEvent(LOCAL, REMOTE);
+        final UniqueAddress localAddress = new UniqueAddress(LOCAL, 1);
+        final UniqueAddress remoteAddress = new UniqueAddress(REMOTE, 2);
+        final ThisActorSystemQuarantinedEvent event = new ThisActorSystemQuarantinedEvent(localAddress, remoteAddress);
         actor.tell(event, ActorRef.noSender());
         verify(callback, timeout(1000)).apply();
     }
index 79ac7b3..2c179d7 100644 (file)
@@ -3,14 +3,11 @@ odl-cluster-data {
   akka {
     remote {
       artery {
-        enabled = off
+        enabled = on
+        transport = tcp
         canonical.hostname = "127.0.0.1"
         canonical.port = 2550
       }
-      classic.netty.tcp {
-        hostname = "127.0.0.1"
-        port = 2550
-      }
       # when under load we might trip a false positive on the failure detector
       # transport-failure-detector {
         # heartbeat-interval = 4 s
@@ -19,8 +16,8 @@ odl-cluster-data {
     }
 
     cluster {
-      # Remove ".tcp" when using artery.
-      seed-nodes = ["akka.tcp://opendaylight-cluster-data@127.0.0.1:2550"]
+      # Using artery.
+      seed-nodes = ["akka://opendaylight-cluster-data@127.0.0.1:2550"]
 
       roles = [
         "member-1"
index 97f8cce..fb0afde 100644 (file)
@@ -56,6 +56,11 @@ odl-cluster-data {
     loggers = ["akka.event.slf4j.Slf4jLogger"]
     logger-startup-timeout = 300s
 
+    # JFR requires boot delegation, which we do not have by default
+    java-flight-recorder {
+      enabled = false
+    }
+
     actor {
       warn-about-java-serializer-usage = off
       provider = "akka.cluster.ClusterActorRefProvider"
@@ -97,8 +102,11 @@ odl-cluster-data {
       }
 
       artery {
+        enabled = on
+        transport = tcp
+
         advanced {
-          #maximum-frame-size = 256 KiB
+          maximum-frame-size = 400 MiB
           #maximum-large-frame-size = 2 MiB
         }
       }
index 0c18e79..e4482f5 100644 (file)
@@ -87,7 +87,7 @@ public class ShardPeerAddressResolverTest {
 
         String peerId = ShardIdentifier.create("default", MEMBER_2, type).toString();
 
-        String address = "akka.tcp://opendaylight-cluster-data@127.0.0.1:2550/user/shardmanager-" + type
+        String address = "akka://opendaylight-cluster-data@127.0.0.1:2550/user/shardmanager-" + type
                 + "/" + MEMBER_2.getName() + "-shard-default-" + type;
 
         resolver.setResolved(peerId, address);