hangc0276 commented on code in PR #4324:
URL: https://github.com/apache/bookkeeper/pull/4324#discussion_r1591771218


##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/client/RackawareEnsemblePlacementPolicyImpl.java:
##########
@@ -792,9 +792,6 @@ protected List<BookieNode> 
selectRandomInternal(List<BookieNode> bookiesToSelect
 
             Map<BookieNode, WeightedObject> rackMap = new HashMap<BookieNode, 
WeightedObject>();
             for (BookieNode n : bookiesToSelectFrom) {
-                if (excludeBookies.contains(n)) {
-                    continue;
-                }

Review Comment:
   Removing the `excludeBookies` from the `wRSelection` Set is just an 
optimization for reducing the bookies check. However, this optimization 
introduced unexpected check conditions.  In the selected result check, we also 
checked if the selected bookie is in `excludeBookies` set. 
https://github.com/apache/bookkeeper/blob/1ae4be04e20eca4490b52da474d455a2414168b4/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/RackawareEnsemblePlacementPolicyImpl.java#L736-L738
   
   In another method `selectRandomInternal`, it also did not filtered the 
excluded bookies from `wRSelection` set
   
https://github.com/apache/bookkeeper/blob/1ae4be04e20eca4490b52da474d455a2414168b4/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/RackawareEnsemblePlacementPolicyImpl.java#L794-L803



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