Fix prefix shard configuration update handling 85/75385/2
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 22 Aug 2018 16:48:30 +0000 (18:48 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Wed, 22 Aug 2018 16:52:01 +0000 (18:52 +0200)
If the list of shards is completely deleted, we end up jumping
into an empty method -- obviously missing updates. This codepath
is really shared, as DataTreeCandidateNode resolves recursively,
creating apropriate delta for children.

Change-Id: I6a70421a5ca405830a1012798f302b390b7aa2f0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/sharding/PrefixedShardConfigUpdateHandler.java

index 0fdd25b..1e66728 100644 (file)
@@ -97,21 +97,19 @@ public class PrefixedShardConfigUpdateHandler {
             switch (candidate.getRootNode().getModificationType()) {
                 case UNMODIFIED:
                     break;
-                case SUBTREE_MODIFIED:
                 case APPEARED:
-                case WRITE:
-                    resolveWrite(candidate.getRootNode());
-                    break;
                 case DELETE:
                 case DISAPPEARED:
-                    resolveDelete(candidate.getRootNode());
+                case SUBTREE_MODIFIED:
+                case WRITE:
+                    resolveModifiedRoot(candidate.getRootNode());
                     break;
                 default:
                     break;
             }
         }
 
-        private void resolveWrite(final DataTreeCandidateNode rootNode) {
+        private void resolveModifiedRoot(final DataTreeCandidateNode rootNode) {
 
             LOG.debug("{}: New config received {}", logName, rootNode);
             LOG.debug("{}: Data after: {}", logName, rootNode.getDataAfter());
@@ -183,10 +181,6 @@ public class PrefixedShardConfigUpdateHandler {
             handlingActor.tell(message, noSender());
         }
 
-        private void resolveDelete(final DataTreeCandidateNode rootNode) {
-
-        }
-
         @Override
         public String toString() {
             return "ShardConfigHandler [logName=" + logName + ", handlingActor=" + handlingActor + "]";

©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.