[fix][broker] fix the local police IsolationGroups cover the defaultIsolationGroups when init managedLedger bookkeeper client
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.
- If we set
bookkeeperClientIsolationGroups=aGroupinbroker.confand local policy setset-bookie-affinity-group public/default --primary-group bGroup, thedefaultIsolationGroupsbe set asbGroupwhen init bookkeeper client , and after invokedelete-bookie-affinity-group, there are choice bookies inbGroup, the correct behavior isaGroupwhich we set intbroker.conf. - If we don't set
bookkeeperClientIsolationGroups=inbroker.conf, and local policy setset-bookie-affinity-group public/default --primary-group bGroup, thedefaultIsolationGroupsbe set asbGroupwhen init bookkeeper client , and after invokedelete-bookie-affinity-group, there are choice bookies inbGroup, the correct behavior is no more isolation policy.
As the suggestion, we should use the broker.conf setting as the defaultIsolationGroups always, and the local policy as the dynamic config to change the Isolation groups though the customMetadata in newEnsemble or replaceBookie method.
To Reproduce
The unit test can help reproduce the bug.
Modifications
- When create bookkeeper client In
BookKeeperClientFactoryImpl.class, add theServiceConfiguration's IsolatedBookieEnsemblePlacementPolicytobkConfif not empty. - When create bookkeeper client In
BookKeeperClientFactoryImpl.class, cancel to set the local policyBookieAffinityGroupproperties to bkConf, to avoid cover theISOLATION_BOOKIE_GROUPSif theServiceConfiguration's IsolatedBookieEnsemblePlacementPolicyis empty. - Modify
bookieMappingCacheinit time to adapt theServiceConfiguration's IsolatedBookieEnsemblePlacementPolicyis empty case. - add some unit test.
Documentation
- [X]
doc-not-needed
@codelipenghui @Jason918 Could you help to review this PR, Thx.
/pulsarbot run-failure-checks
The pr had no activity for 30 days, mark with Stale label.