Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add bundle split capabilities in ModularLoadManagerImpl #385

Closed
wants to merge 3 commits into from

Conversation

bobbeyreese
Copy link
Contributor

Motivation

ModularLoadManagerImpl lacked bundle split capabilities. Additionally, automatic bundle splits reassigned the bundles to the same broker when the bundle could more usefully be reassigned after being split.

Modifications

Roughly in order of importance:

  • Automatic bundle split is now available in ModularLoadManagerImpl.
  • Automatic bundle split has been altered so that it also unloads the bundle: this allows splits to be reassigned to new brokers.
  • Bundle boundaries are now stored as ZNodes of the same names on ZooKeeper under the local policies. This is necessary because, with automatic bundle splitting without broker affinity, multiple brokers may set the boundaries simultaneously, resulting in inconsistent boundaries if one write overwrites the other. Successful bundle splitting has been observed with as many as 5 bundle splits on the same namespace happening simultaneously.
  • ZooKeeperCache will now always put a watch on a node, even if it did not previously exist. This is done via using the capability of ZooKeeper.exists to put a watch on non-existent nodes.
  • BundleSplitStrategy has been added to allow the injection of automatic bundle splitting behavior.
  • loadBalancerAutoBundleSplitEnabled is now a dynamic configuration.
  • BundleData -> TimeAverageBundleData
  • New class BundleData holds non-time average (numBundles/Topics, etc) bundle values
  • New class 'MessageData` holds message rate in/out and throughput in/out.
  • Components of ModularLoadManagerImplsuch as ModularLoadManagerStrategy are now exposed the PulsarService instance instead of ServiceConfiguration to give more information and freedom.

Result

This PR adds a bundle split mechanism for ModularLoadManagerImpl and changes bundle splitting behavior so that bundles which are split are also unloaded, so that the splits may be assigned to new brokers.

@rdhabalia rdhabalia added type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages type/feature The PR added a new feature or issue requested a new feature labels Apr 29, 2017
@rdhabalia rdhabalia added this to the 1.18 milestone Apr 29, 2017
@@ -289,28 +290,38 @@ public Boolean call() throws Exception {

// Broker doesn't restart on global-zk session lost: so handling unexpected exception
try {
this.zkSession.get().getData(path, watcher, (rc, path1, ctx, content, stat) -> {
// Put watch on the node no matter what
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you describe this change a bit more? Since it doesn't affect only the bundle splitting in the load manager, it would be better to split it in a separate PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure! This uses the capability of ZooKeeper.exists to put a watch on nonexistent nodes. The absence of this behavior caused an issue in which namespace bundle boundary updates were not being seen across all brokers. I will make a separate PR w/ just the cache change.

@rdhabalia
Copy link
Contributor

should we close this PR in favor of #857 ?

@merlimat merlimat removed this from the 1.21.0-incubating milestone Oct 27, 2017
@merlimat
Copy link
Contributor

Yes closing for #857

@merlimat merlimat closed this Oct 27, 2017
hrsakai pushed a commit to hrsakai/pulsar that referenced this pull request Dec 10, 2020
…#385)

Signed-off-by: Pavel Agaletskiy <psagaletskiy@avito.ru>

Co-authored-by: Pavel Agaletskiy <psagaletskiy@avito.ru>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages type/feature The PR added a new feature or issue requested a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants