strongduanmu commented on code in PR #34251:
URL: https://github.com/apache/shardingsphere/pull/34251#discussion_r1903198405


##########
features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/rule/checker/ShardingRuleChecker.java:
##########
@@ -64,7 +64,7 @@ public void check(final ShardingRuleConfiguration ruleConfig) 
{
     
     private void checkUniqueActualDataNodesInTableRules() {
         Collection<DataNode> uniqueActualDataNodes = new 
HashSet<>(shardingRule.getShardingTables().size(), 1F);
-        shardingRule.getShardingTables().forEach((key, value) -> 
checkUniqueActualDataNodes(uniqueActualDataNodes, key, 
value.getActualDataNodes().iterator().next()));
+        shardingRule.getShardingTables().forEach((key, value) -> 
value.getActualDataNodes().forEach(each -> 
checkUniqueActualDataNodes(uniqueActualDataNodes, key, each)));

Review Comment:
   If `actualDataNodes` contains many nodes, checking all nodes will take more 
time. Is it possible to add a props to control whether to check all 
`actualDataNodes` or `sampleDataNode`?



-- 
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