Skip to content

Fix region aware placement policy disk weight dose not update.#4522

Merged
StevenLuMT merged 2 commits into
apache:masterfrom
dragonls:fix_region_aware_placement_policy_disk_weight_does_not_update
Feb 14, 2025
Merged

Fix region aware placement policy disk weight dose not update.#4522
StevenLuMT merged 2 commits into
apache:masterfrom
dragonls:fix_region_aware_placement_policy_disk_weight_does_not_update

Conversation

@dragonls

@dragonls dragonls commented Nov 11, 2024

Copy link
Copy Markdown
Contributor

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

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.

@dragonls
dragonls force-pushed the fix_region_aware_placement_policy_disk_weight_does_not_update branch from da24cb8 to f4901c7 Compare November 11, 2024 09:58

@dlg99 dlg99 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.
Thank you for the fix.

@StevenLuMT StevenLuMT left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good jobs

@StevenLuMT StevenLuMT closed this Feb 14, 2025
@StevenLuMT StevenLuMT reopened this Feb 14, 2025
@StevenLuMT

Copy link
Copy Markdown
Member

reopen's reason: rerun failure checks

@liangyepianzhou liangyepianzhou left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@StevenLuMT
StevenLuMT merged commit 55d274b into apache:master Feb 14, 2025

@hangc0276 hangc0276 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job!

hangc0276 pushed a commit that referenced this pull request Jun 4, 2025
* Fix region aware placement policy disk weight dose not update.

(cherry picked from commit 55d274b)
hangc0276 pushed a commit that referenced this pull request Jun 4, 2025
* Fix region aware placement policy disk weight dose not update.

(cherry picked from commit 55d274b)
priyanshu-ctds pushed a commit to datastax/bookkeeper that referenced this pull request Jul 11, 2025
…e#4522)

* Fix region aware placement policy disk weight dose not update.

(cherry picked from commit 55d274b)
(cherry picked from commit fbd5148)
sandeep-ctds pushed a commit to datastax/bookkeeper that referenced this pull request Jul 22, 2025
…e#4522)

* Fix region aware placement policy disk weight dose not update.

(cherry picked from commit 55d274b)
(cherry picked from commit fbd5148)
manas-ctds pushed a commit to datastax/bookkeeper that referenced this pull request Feb 27, 2026
…e#4522)

* Fix region aware placement policy disk weight dose not update.

(cherry picked from commit 55d274b)
(cherry picked from commit f507b1c)
dlg99 pushed a commit to datastax/bookkeeper that referenced this pull request Feb 27, 2026
…e#4522)

* Fix region aware placement policy disk weight dose not update.

(cherry picked from commit 55d274b)
(cherry picked from commit f507b1c)
@hangc0276 hangc0276 added this to the 4.18.0 milestone May 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants