Nicklee007 opened a new pull request, #16325:
URL: https://github.com/apache/pulsar/pull/16325

   ### Motivation
   Fix the local police IsolationGroups cover the defaultIsolationGroups when 
init managedLedger bookkeeper client, which will cause even we 
delete-bookie-affinity-group and always used the last BookieAffinityGroup 
setting.
   1. If we set `bookkeeperClientIsolationGroups=aGroup` in `broker.conf ` and 
local policy set `set-bookie-affinity-group public/default --primary-group 
bGroup`,  the `defaultIsolationGroups` be set as `bGroup` when init bookkeeper 
client ,  and after invoke  `delete-bookie-affinity-group`, there are choice 
bookies in `bGroup`, the correct behavior is `aGroup` which we set int 
`broker.conf`.
   2. If we don't set `bookkeeperClientIsolationGroups=` in `broker.conf` , and 
local policy set `set-bookie-affinity-group public/default --primary-group 
bGroup`, the `defaultIsolationGroups` be set as `bGroup` when init bookkeeper 
client , and after invoke  `delete-bookie-affinity-group`, there are choice 
bookies in `bGroup`, the correct behavior is no more isolation policy.
   
   #### To Reproduce
   The unit test can help reproduce the bug , but it running success is also 
depend on another PR #16273 which is fix the `defaultIsolationGroups` be  
permanent covered when invoke newEnsemble, so we need merge  PR #16273 firstly.
   
   ### Modifications
   
   1.  When create bookkeeper client In `BookKeeperClientFactoryImpl.class`  , 
add the `ServiceConfiguration's IsolatedBookieEnsemblePlacementPolicy` to 
`bkConf` if not empty.
   3. When create bookkeeper client In `BookKeeperClientFactoryImpl.class`,  
cancel to  set the local policy `BookieAffinityGroup` properties to bkConf, to 
avoid cover the `ISOLATION_BOOKIE_GROUPS` if  the `ServiceConfiguration's 
IsolatedBookieEnsemblePlacementPolicy` is empty.
   4.  Modify `bookieMappingCache` init time to adapt the  
`ServiceConfiguration's IsolatedBookieEnsemblePlacementPolicy` is empty case.
   5. add some unit test.
   
   
   ### Documentation
   - [X] `doc-not-needed` 
   
   


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