[
https://issues.apache.org/jira/browse/IOTDB-2025?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17458138#comment-17458138
]
FengQingxin commented on IOTDB-2025:
------------------------------------
I did a retest with iotdb-master【0224027c50ecca51ae3f40f2f9abc9710b1fe7ac】
which is after your PR.
but I still can get a Incorrect count result of nodes in cluster
!image-2021-12-13-11-20-47-854.png!
> Incorrect count result of nodes and devices in cluster
> ------------------------------------------------------
>
> Key: IOTDB-2025
> URL: https://issues.apache.org/jira/browse/IOTDB-2025
> Project: Apache IoTDB
> Issue Type: Bug
> Components: Core/Cluster
> Reporter: Eric Pai
> Assignee: Eric Pai
> Priority: Major
> Labels: pull-request-available
> Fix For: master branch
>
> Attachments: 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,
> image-2021-12-13-11-20-47-854.png
>
>
> 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)