BUG-2138: Use correct actor context in shard lookup. 38/49738/25
authorJakub Morvay <jmorvay@cisco.com>
Wed, 8 Mar 2017 17:32:43 +0000 (18:32 +0100)
committerJakub Morvay <jmorvay@cisco.com>
Sat, 18 Mar 2017 08:47:22 +0000 (09:47 +0100)
Typo since we cannot have all lookups being routed into
config.

Change-Id:I708787d7e5e6136b6a22d6f402071702a6de412b
Signed-off-by: Tomas Cere <tcere@cisco.com>
Signed-off-by: Jakub Morvay <jmorvay@cisco.com>
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/sharding/ShardedDataTreeActor.java

index 04a75628b7d8d6583b661b27ce71d9f6a7e3ccac..e8f3f708607322706e617c5d1bd28426f058c9af 100644 (file)
@@ -67,6 +67,7 @@ import org.opendaylight.controller.cluster.sharding.messages.PrefixShardRemoved;
 import org.opendaylight.controller.cluster.sharding.messages.ProducerCreated;
 import org.opendaylight.controller.cluster.sharding.messages.ProducerRemoved;
 import org.opendaylight.controller.cluster.sharding.messages.RemovePrefixShard;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
 import org.opendaylight.mdsal.dom.api.DOMDataTreeIdentifier;
 import org.opendaylight.mdsal.dom.api.DOMDataTreeProducer;
 import org.opendaylight.mdsal.dom.api.DOMDataTreeProducerException;
@@ -378,10 +379,14 @@ public class ShardedDataTreeActor extends AbstractUntypedPersistentActor {
 
         replicator.tell(update, self());
 
+        final ActorContext context =
+                configuration.getPrefix().getDatastoreType() == LogicalDatastoreType.CONFIGURATION
+                        ? distributedConfigDatastore.getActorContext() : distributedOperDatastore.getActorContext();
+
         // schedule a notification task for the reply
         actorSystem.scheduler().scheduleOnce(SHARD_LOOKUP_TASK_INTERVAL,
                 new ShardCreationLookupTask(actorSystem, getSender(), clusterWrapper,
-                        actorContext, shardingService, configuration.getPrefix()),
+                        context, shardingService, configuration.getPrefix()),
                 actorSystem.dispatcher());
     }