You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bookkeeper.apache.org by GitBox <gi...@apache.org> on 2022/12/27 09:30:01 UTC

[GitHub] [bookkeeper] horizonzy opened a new issue, #3720: RackAware placement policy can not try-my-best to ensure replicas located into different racks.

horizonzy opened a new issue, #3720:
URL: https://github.com/apache/bookkeeper/issues/3720

   Add the following test into TestRackawareEnsemblePlacementPolicy.java can reproduce the issue.
   
   ```
   @Test
       public void testNewEnsemblePolicyWithMultipleRacks() throws Exception {
           BookieSocketAddress addr1 = new BookieSocketAddress("127.0.0.1", 3181);
           BookieSocketAddress addr2 = new BookieSocketAddress("127.0.0.2", 3181);
           BookieSocketAddress addr3 = new BookieSocketAddress("127.0.0.3", 3181);
           BookieSocketAddress addr4 = new BookieSocketAddress("127.0.0.4", 3181);
           // update dns mapping
           StaticDNSResolver.addNodeToRack(addr1.getHostName(), "/default-region/r1");
           StaticDNSResolver.addNodeToRack(addr2.getHostName(), "/default-region/r1");
           StaticDNSResolver.addNodeToRack(addr3.getHostName(), "/default-region/r2");
           StaticDNSResolver.addNodeToRack(addr4.getHostName(), "/default-region/r3");
           // Update cluster
           Set<BookieId> addrs = new HashSet<BookieId>();
           addrs.add(addr1.toBookieId());
           addrs.add(addr2.toBookieId());
           addrs.add(addr3.toBookieId());
           addrs.add(addr4.toBookieId());
           repp.onClusterChanged(addrs, new HashSet<BookieId>());
   
           try {
               int ensembleSize = 3;
               int writeQuorumSize = 3;
               int ackQuorumSize = 2;
   
               Set<BookieId> excludeBookies = new HashSet<>();
   
               for (int i = 0; i < 50; ++i) {
                   EnsemblePlacementPolicy.PlacementResult<List<BookieId>> ensembleResponse =
                       repp.newEnsemble(ensembleSize, writeQuorumSize,
                           ackQuorumSize, null, excludeBookies);
                   List<BookieId> ensemble = ensembleResponse.getResult();
   
                   if (ensemble.contains(addr1.toBookieId()) && ensemble.contains(addr2.toBookieId())) {
                       //The best ensemble choose is addr3,addr4,(addr1/addr2)
                       LOG.error("addr1 and addr2 is same rack info.");
                   }
               }
           } catch (Exception e ){
               LOG.error("failed ", e);
           }
       }
   ```


-- 
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: commits-unsubscribe@bookkeeper.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [bookkeeper] hangc0276 closed issue #3720: RackAware placement policy can not try-my-best to ensure replicas located into different racks.

Posted by "hangc0276 (via GitHub)" <gi...@apache.org>.
hangc0276 closed issue #3720: RackAware placement policy can not try-my-best to ensure replicas located into different racks.
URL: https://github.com/apache/bookkeeper/issues/3720


-- 
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: commits-unsubscribe@bookkeeper.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [bookkeeper] horizonzy commented on issue #3720: RackAware placement policy can not try-my-best to ensure replicas located into different racks.

Posted by GitBox <gi...@apache.org>.
horizonzy commented on issue #3720:
URL: https://github.com/apache/bookkeeper/issues/3720#issuecomment-1366277724

   If we use `minNumRacksPerWriteQuorum` and `enforceMinNumRacksPerWriteQuorum ` to enforce the min different rack, when there are not enough different racks, it can't work.
   
   I think we should try to find different racks when there are enough different racks, if there are not enough different racks, it still can step down to adhere to the `minNumRacksPerWriteQuorum`.


-- 
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: commits-unsubscribe@bookkeeper.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [bookkeeper] dlg99 commented on issue #3720: RackAware placement policy can not try-my-best to ensure replicas located into different racks.

Posted by GitBox <gi...@apache.org>.
dlg99 commented on issue #3720:
URL: https://github.com/apache/bookkeeper/issues/3720#issuecomment-1366037716

   You may need to set minNumRacksPerWriteQuorum and enforceMinNumRacksPerWriteQuorum (default false) for the RackAware policy


-- 
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: commits-unsubscribe@bookkeeper.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org