horizonzy commented on code in PR #4118:
URL: https://github.com/apache/bookkeeper/pull/4118#discussion_r1372680596
##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/client/RackawareEnsemblePlacementPolicyImpl.java:
##########
@@ -507,13 +507,27 @@ public PlacementResult<BookieId> replaceBookie(int
ensembleSize, int writeQuorum
try {
excludeBookies =
addDefaultRackBookiesIfMinNumRacksIsEnforced(excludeBookies);
excludeBookies.addAll(currentEnsemble);
+
+ Set<Node> ensembleNodes = new HashSet<>();
+ Set<Node> excludeNodes = new HashSet<>();
BookieNode bn = knownBookies.get(bookieToReplace);
if (null == bn) {
bn = createBookieNode(bookieToReplace);
}
-
- Set<Node> ensembleNodes = convertBookiesToNodes(currentEnsemble);
- Set<Node> excludeNodes = convertBookiesToNodes(excludeBookies);
+ for (BookieId bookieId : currentEnsemble) {
+ if (bookieId.equals(bookieToReplace)) {
+ ensembleNodes.add(bn);
Review Comment:
Make sense.
--
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]