reddycharan commented on a change in pull request #1397: Bookies should be from 
different racks in a Writequorum.
URL: https://github.com/apache/bookkeeper/pull/1397#discussion_r188794529
 
 

 ##########
 File path: 
bookkeeper-server/src/main/java/org/apache/bookkeeper/client/RackawareEnsemblePlacementPolicyImpl.java
 ##########
 @@ -542,9 +544,58 @@ public void 
handleBookiesThatJoined(Set<BookieSocketAddress> joinedBookies) {
                         curRack = localNode.getNetworkLocation();
                     }
                 } else {
-                    curRack = "~" + prevNode.getNetworkLocation();
+                    StringBuilder sb = new StringBuilder();
+                    sb.append("~");
+
+                    if (writeQuorumSize > 1) {
+                        /*
+                         * Ideally RackAwareEnsemblePlacementPolicy should try
+                         * to select bookies from different racks for a write
+                         * quorum. So in a WriteQuorum, bookies should be from
+                         * WriteQuorum number of racks. So we would add racks 
of
+                         * (WriteQuorumSize-1) neighbours (both sides) to the
+                         * exclusion list (~curRack).
+                         */
+                        for (int j = 1; j < writeQuorumSize; j++) {
 
 Review comment:
   changed logic to honor minNumRacksPerWriteQuorum config value.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to