pulsar
pulsar copied to clipboard
[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=aGroup
inbroker.conf
and local policy setset-bookie-affinity-group public/default --primary-group bGroup
, thedefaultIsolationGroups
be set asbGroup
when init bookkeeper client , and after invokedelete-bookie-affinity-group
, there are choice bookies inbGroup
, the correct behavior isaGroup
which we set intbroker.conf
. - If we don't set
bookkeeperClientIsolationGroups=
inbroker.conf
, and local policy setset-bookie-affinity-group public/default --primary-group bGroup
, thedefaultIsolationGroups
be set asbGroup
when 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 IsolatedBookieEnsemblePlacementPolicy
tobkConf
if not empty. - When create bookkeeper client In
BookKeeperClientFactoryImpl.class
, cancel to set the local policyBookieAffinityGroup
properties to bkConf, to avoid cover theISOLATION_BOOKIE_GROUPS
if theServiceConfiguration's IsolatedBookieEnsemblePlacementPolicy
is empty. - Modify
bookieMappingCache
init time to adapt theServiceConfiguration's IsolatedBookieEnsemblePlacementPolicy
is 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.