BUG-8372: add dataTree information 70/56870/1
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 4 May 2017 15:56:33 +0000 (17:56 +0200)
committerTom Pantelis <tompantelis@gmail.com>
Thu, 11 May 2017 16:06:49 +0000 (16:06 +0000)
We are attempting to send a local message to a remote actor,
which seems to be a mixup with data tree presence. Add dataTree
to toString() output so we know which connections resolve to
being local and which to being remote.

Change-Id: If1ed3cfdea24148456a4d310949fb480791c1ffa
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 3f8818fd65f1cac8f4b2ce3b7319255137c74da5)

opendaylight/md-sal/cds-access-client/src/main/java/org/opendaylight/controller/cluster/access/client/BackendInfo.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/AbstractProxyTransaction.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/LocalProxyTransaction.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/ShardBackendInfo.java

index 85d9f14..cea174b 100644 (file)
@@ -66,7 +66,7 @@ public class BackendInfo {
 
     @Override
     public final String toString() {
-        return addToStringAttributes(MoreObjects.toStringHelper(this)).toString();
+        return addToStringAttributes(MoreObjects.toStringHelper(this).omitNullValues()).toString();
     }
 
     protected ToStringHelper addToStringAttributes(final ToStringHelper toStringHelper) {
index 2fa9898..ed34b3e 100644 (file)
@@ -508,7 +508,7 @@ abstract class AbstractProxyTransaction implements Identifiable<TransactionIdent
 
             if (getIdentifier().equals(req.getTarget())) {
                 Verify.verify(req instanceof TransactionRequest, "Unhandled request %s", req);
-                LOG.debug("Forwarding queued request{} to successor {}", req, successor);
+                LOG.debug("Forwarding queued request {} to successor {}", req, successor);
                 successor.handleForwardedRemoteRequest((TransactionRequest<?>) req, e.getCallback());
                 it.remove();
             }
index 747fd14..3aed0dc 100644 (file)
@@ -109,7 +109,7 @@ abstract class LocalProxyTransaction extends AbstractProxyTransaction {
     }
 
     @Override
-    void forwardToRemote(final RemoteProxyTransaction successor, final TransactionRequest<?> request,
+    final void forwardToRemote(final RemoteProxyTransaction successor, final TransactionRequest<?> request,
                          final Consumer<Response<?, ?>> callback) {
         if (request instanceof CommitLocalTransactionRequest) {
             final CommitLocalTransactionRequest req = (CommitLocalTransactionRequest) request;
index 92a213d..c906e1a 100644 (file)
@@ -57,6 +57,7 @@ final class ShardBackendInfo extends BackendInfo {
 
     @Override
     protected ToStringHelper addToStringAttributes(final ToStringHelper toStringHelper) {
-        return super.addToStringAttributes(toStringHelper).add("cookie", cookie).add("shard", shardName);
+        return super.addToStringAttributes(toStringHelper).add("cookie", cookie).add("shard", shardName)
+                .add("dataTree", dataTree.orElse(null));
     }
 }

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.