You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/02/14 10:29:37 UTC

[GitHub] [pulsar] hangc0276 commented on a change in pull request #14248: fix rackaware placement policy does not take effect after delete rack configuration

hangc0276 commented on a change in pull request #14248:
URL: https://github.com/apache/pulsar/pull/14248#discussion_r805702221



##########
File path: pulsar-broker-common/src/main/java/org/apache/pulsar/bookie/rackawareness/BookieRackAffinityMapping.java
##########
@@ -201,7 +216,16 @@ private void handleUpdates(Notification n) {
                                 bookieAddressList.add(BookieId.parse(addr));
                             }
                         }
-                        rackawarePolicy.onBookieRackChange(bookieAddressList);
+                        if (LOG.isDebugEnabled()) {
+                            LOG.debug("Bookies with rack update from {} to {}", bookieAddressListLastTime,
+                                    bookieAddressList);
+                        }
+                        if (bookieAddressListLastTime.size() > bookieAddressList.size()) {

Review comment:
       @aloyszhang Thanks for you contribution. 
   For the following case:
   old rack placement map:
   rack0 bookie0
   rack0 bookie2
   rack0 bookie3
   rack1 bookie4
   rack1 bookie5
   rack1 bookie6
   ===>
   new rack placement map:
   rack0 bookie0
   rack0 bookie2
   rack0 bookie3
   rack2 bookie10
   rack2 bookie11
   
   The new rack placement map won't take affect until next update. 
   Please add a test to cover this case.




-- 
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@pulsar.apache.org

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