dragonls opened a new pull request, #4522:
URL: https://github.com/apache/bookkeeper/pull/4522

   ### Motivation
   
   We are using region aware policy in our Pulsar cluster and enable the disk 
weight base placement feature.
   > 
`ensemblePlacementPolicy=org.apache.bookkeeper.client.RegionAwareEnsemblePlacementPolicy`
   > `bookkeeperDiskWeightBasedPlacementEnabled=false`
   
   There are different CVMs with different free disk space in a region, but we 
found that the traffic still seems to be balanced and is not distributed 
according to the weight of the free disk space.
   
   The root cause of this case is that the disk weight information actually 
used to allocate bookies in `RegionAwareEnsemblePlacementPolicy` has not been 
updated at all.
   
   The `RegionAwareEnsemblePlacementPolicy` actually choose bookies for 
ensemble by `RackawareEnsemblePlacementPolicy` of each region in 
`perRegionPlacement`, see 
`org.apache.bookkeeper.client.RegionAwareEnsemblePlacementPolicy#newEnsemble`. 
`RegionAwareEnsemblePlacementPolicy.updateBookieInfo` dose not update the 
`bookieInfoMap` in `RackawareEnsemblePlacementPolicy` of each region in 
`perRegionPlacement`, which results that the disk weight information actually 
used to allocate bookies in `RegionAwareEnsemblePlacementPolicy` has not been 
updated at all.
   
   ### Changes
   
   1. Overwrites the `updateBookieInfo` in 
`RegionAwareEnsemblePlacementPolicy`, update the bookie info in 
`RackawareEnsemblePlacementPolicy` of each region in `perRegionPlacement`.
   2. Add test cases 
`org.apache.bookkeeper.client.TestRegionAwareEnsemblePlacementPolicy#testRegionsWithDifferentDiskWeight`.
   


-- 
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]

Reply via email to