Skip to content

Commit 82f2dc4

Browse files
authored
Fixed the configMTree deserialisation bug for "root" database (#16961)
1 parent ad0416e commit 82f2dc4

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/persistence/schema/ConfigMTree.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,15 +1109,13 @@ public void deserialize(final InputStream inputStream) throws IOException {
11091109
name = tableNode.getName();
11101110
stack.push(new Pair<>(tableNode, false));
11111111
} else {
1112-
// Currently internal mNode will not be the leaf node and thus will not be deserialized here
1113-
// This is just in case
11141112
internalMNode = deserializeInternalMNode(inputStream);
11151113
ReadWriteIOUtils.readInt(inputStream);
11161114
name = internalMNode.getName();
11171115
stack.push(new Pair<>(internalMNode, false));
11181116
}
11191117

1120-
while (!PATH_ROOT.equals(name)) {
1118+
while (!PATH_ROOT.equals(name) || type != INTERNAL_MNODE_TYPE) {
11211119
type = ReadWriteIOUtils.readByte(inputStream);
11221120
switch (type) {
11231121
case INTERNAL_MNODE_TYPE:

iotdb-core/confignode/src/test/java/org/apache/iotdb/confignode/persistence/schema/ConfigMTreeTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ public void testGetNodeListInLevel() throws MetadataException {
261261
public void testSerialization() throws Exception {
262262
final PartialPath[] pathList =
263263
new PartialPath[] {
264-
new PartialPath("root.sg"),
264+
new PartialPath("root.`root`"),
265265
new PartialPath("root.a.sg"),
266266
new PartialPath("root.a.b.sg"),
267267
new PartialPath("root.a.a.b.sg")

0 commit comments

Comments
 (0)