SzyWilliam commented on code in PR #15014:
URL: https://github.com/apache/iotdb/pull/15014#discussion_r2005692695


##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/distribute/TableModelQueryFragmentPlanner.java:
##########
@@ -124,6 +128,14 @@ private void produceFragmentInstance(
     // Get the target region for origin PlanFragment, then its instance will 
be distributed one
     // of them.
     TRegionReplicaSet regionReplicaSet = 
fragment.getTargetRegionForTableModel(nodeDistributionMap);
+    if (regionReplicaSet != null
+        && !CollectionUtils.isEmpty(regionReplicaSet.getDataNodeLocations())) {
+      regionReplicaSet = topology.getReachableSet(regionReplicaSet);
+      if (regionReplicaSet.getDataNodeLocations().isEmpty()) {
+        throw new ReplicaSetUnreachableException(
+            fragment.getTargetRegionForTableModel(nodeDistributionMap));
+      }
+    }

Review Comment:
   There are too much code duplications between `SimpleFragmentParallelPlanner` 
and `TableModelQueryFragmentPlanner`. Let's bring a new PR to refactor this 
issue later on instead of making current patch too complicated.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to