FengQingxin created IOTDB-2134:
----------------------------------

             Summary: CLONE - Incorrect count result of nodes and devices in 
cluster
                 Key: IOTDB-2134
                 URL: https://issues.apache.org/jira/browse/IOTDB-2134
             Project: Apache IoTDB
          Issue Type: Bug
          Components: Core/Cluster
            Reporter: FengQingxin
            Assignee: Eric Pai
             Fix For: master branch


This bug can be reappeared by replaying the test case 
IoTDBMetadataFetchIT.showCountDevices and IoTDBMetadataFetchIT.showCountNodes.

!image-2021-11-17-15-33-09-569.png!

!image-2021-11-17-15-33-32-630.png!

!image-2021-11-17-15-33-49-732.png!

The root causes are:

 

1. In nodes count implemented in ClusterPlanExecutor, if there's a SG 
{_}root.a.b{_}, and a query {_}COUNT NODE root LEVEL=1{_}, we should return 1 
immediately instead of sending to the SG leader, which returns 0. 

In a word, for any LEVEL value being less than a storage group path nodes 
length, we can get the result without sending to other nodes to query.

 

2.In devices count implemented in ClusterPlanExecutor, the query path should be 
set properly if it should be transmitted to other nodes.

e.g. If we have a SG _root.a.b.c_ and a query {_}COUNT DEVICE root.a.b{_}, we 
should pass _root.a.b.c_ to other nodes as it's the actual storage group name, 
not _root.a.b_

if we have a SG _root.a_ and a query {_}COUNT DEVICE root.a.b{_}, we should 
pass _root.a.b_ to other nodes as it's the actual path we queried.

In a word, at least one SG should be the prefix path of the one passed to other 
nodes.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to