Shawyeok commented on code in PR #25825:
URL: https://github.com/apache/pulsar/pull/25825#discussion_r3286250201
##########
pulsar-broker-common/src/main/java/org/apache/pulsar/bookie/rackawareness/IsolatedBookieEnsemblePlacementPolicy.java:
##########
@@ -215,13 +218,7 @@ Set<BookieId> getExcludedBookiesWithIsolationGroups(int
ensembleSize,
return excludedBookies;
}
int totalAvailableBookiesInPrimaryGroup = 0;
- Set<String> primaryIsolationGroup = Collections.emptySet();
- Set<String> secondaryIsolationGroup = Collections.emptySet();
Set<BookieId> primaryGroupBookies = new HashSet<>();
- if (isolationGroups != null) {
- primaryIsolationGroup = isolationGroups.getLeft();
- secondaryIsolationGroup = isolationGroups.getRight();
- }
for (String group : allGroups) {
Set<String> bookiesInGroup =
allGroupsBookieMapping.get(group).keySet();
if (!primaryIsolationGroup.contains(group)) {
Review Comment:
@void-ptr974
Good point! The tricky part is that handling of empty isolation group in
IsolatedBookieEnsemblePlacementPolicy. Now it as treated as negative for all
bookies.
Currently, we can only call the getExcludedBookiesWithIsolationGroups method
before resolving any possible pair of null scenarios.
--
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]