pulsar icon indicating copy to clipboard operation
pulsar copied to clipboard

[fix][broker] fix the local police IsolationGroups cover the defaultIsolationGroups when init managedLedger bookkeeper client

Open Nicklee007 opened this issue 2 years ago • 3 comments

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.

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

  1. When create bookkeeper client In BookKeeperClientFactoryImpl.class , add the ServiceConfiguration's IsolatedBookieEnsemblePlacementPolicy to bkConf if not empty.
  2. 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.
  3. Modify bookieMappingCache init time to adapt the ServiceConfiguration's IsolatedBookieEnsemblePlacementPolicy is empty case.
  4. add some unit test.

Documentation

  • [X] doc-not-needed

Nicklee007 avatar Jul 01 '22 08:07 Nicklee007

@codelipenghui @Jason918 Could you help to review this PR, Thx.

Nicklee007 avatar Jul 26 '22 04:07 Nicklee007

/pulsarbot run-failure-checks

Nicklee007 avatar Aug 25 '22 06:08 Nicklee007

The pr had no activity for 30 days, mark with Stale label.

github-actions[bot] avatar Oct 22 '22 02:10 github-actions[bot]