Bug 9008: Fix the error of the persisted journal data format 67/61967/3
authorHeYunBo <he.yunbo@zte.com.cn>
Fri, 18 Aug 2017 12:31:39 +0000 (20:31 +0800)
committerRobert Varga <nite@hq.sk>
Fri, 1 Sep 2017 06:29:18 +0000 (06:29 +0000)
We have to clear the lastLeafSetQName while processing the end event for node
in NormalizedNodeInputStreamReader and AbstractNormalizedNodeDataOutput.

Otherwise while processing the leaf-list node, the leaf-list entry node
may use the other LeafSetQName as it's node identifier incorrectly.
The DataTree reconstructed from the persisted journal after the controller
restart will be not equal to the DataTree before restart under certain
circumstances.

Change-Id: I4ee823f59fe477d08f982ae73e3850433dfea8ee
Signed-off-by: HeYunBo <he.yunbo@zte.com.cn>
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/AbstractNormalizedNodeDataOutput.java [changed mode: 0644->0755]
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/NormalizedNodeInputStreamReader.java [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index a057a35..c4db272
@@ -311,7 +311,7 @@ abstract class AbstractNormalizedNodeDataOutput implements NormalizedNodeDataOut
     @Override
     public void endNode() throws IOException, IllegalStateException {
         LOG.trace("Ending the node");
-
+        lastLeafSetQName = null;
         output.writeByte(NodeTypes.END_NODE);
     }
 

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