Handle owner changed message 05/97305/2
authorTomas Cere <tomas.cere@pantheon.tech>
Tue, 24 Aug 2021 09:07:19 +0000 (11:07 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Tue, 24 Aug 2021 20:45:24 +0000 (22:45 +0200)
We need to handle this response message otherwise
it ends up in dead letters polluting logs.

JIRA: CONTROLLER-1994
Change-Id: Idd110e48a10f2d290b2a587fdd2dcf11f2a89d51
Signed-off-by: Tomas Cere <tomas.cere@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
opendaylight/md-sal/eos-dom-akka/src/main/java/org/opendaylight/controller/eos/akka/owner/supervisor/OwnerSupervisor.java

index c1cf65b..047040a 100644 (file)
@@ -151,6 +151,7 @@ public final class OwnerSupervisor extends AbstractBehavior<OwnerSupervisorComma
         return newReceiveBuilder()
                 .onMessage(CandidatesChanged.class, this::onCandidatesChanged)
                 .onMessage(DeactivateDataCenter.class, this::onDeactivateDatacenter)
+                .onMessage(OwnerChanged.class, this::onOwnerChanged)
                 .onMessage(MemberUpEvent.class, this::onPeerUp)
                 .onMessage(MemberDownEvent.class, this::onPeerDown)
                 .onMessage(MemberReachableEvent.class, this::onPeerReachable)
@@ -164,6 +165,11 @@ public final class OwnerSupervisor extends AbstractBehavior<OwnerSupervisorComma
         return IdleSupervisor.create();
     }
 
+    private Behavior<OwnerSupervisorCommand> onOwnerChanged(final OwnerChanged command) {
+        LOG.debug("Owner has changed for {}", command.getResponse().key());
+        return this;
+    }
+
     private void reassignUnreachableOwners() {
         final Set<String> ownersToReassign = new HashSet<>();
         for (final String owner : ownerToEntity.keys()) {