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:
After looking into the code, there are too much code duplications between
`SimpleFragmentParallelPlanner` and `TableModelQueryFragmentPlanner`. Actually
they share a lot common logic, we can use a base class and move those common
logic into the base class.
How about we keep this patch the same and add a todo to refactor and extract
a common base class later on? We can assign this todo to someone in charge of
planner.
--
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]