Bug 9008: Fix the error of the persisted journal data format 30/62530/2
authorHeYunBo <he.yunbo@zte.com.cn>
Fri, 18 Aug 2017 12:31:39 +0000 (20:31 +0800)
committerRobert Varga <nite@hq.sk>
Wed, 27 Sep 2017 08:21:43 +0000 (08:21 +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>
(cherry picked from commit 0077859d16ed922af1449f075033069f4d9dbffe)

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);
     }