Skip to content

[fix][broker] Handle flow_or_qps bundle split requests in ELM#25442

Open
Denovo1998 wants to merge 2 commits intoapache:masterfrom
Denovo1998:handle_flow_or_qps_bundle_split_request_in_elm
Open

[fix][broker] Handle flow_or_qps bundle split requests in ELM#25442
Denovo1998 wants to merge 2 commits intoapache:masterfrom
Denovo1998:handle_flow_or_qps_bundle_split_request_in_elm

Conversation

@Denovo1998
Copy link
Copy Markdown
Contributor

@Denovo1998 Denovo1998 commented Mar 31, 2026

Motivation

Manual bundle split requests in the extensible load manager path can fail incorrectly when flow_or_qps_equally_divide is used. The broker was building the split option from the default configured algorithm instead of the algorithm requested by the admin API, which can trigger a ClassCastException. In addition, when flow_or_qps_equally_divide cannot
produce a valid split boundary, the extensible load manager path turns that no-op case into
a misleading Bundle ... not found under namespace error.

Modifications

  • build BundleSplitOption from the requested split algorithm instead of the default broker configuration
  • create FlowOrQpsEquallyDivideBundleSplitOption only when the actual requested algorithm is flow_or_qps_equally_divide
  • handle the "no valid split boundary" case as a no-op in ExtensibleLoadManagerImpl instead of reporting Bundle ... not found under namespace
  • keep the real bundle not found error path only for actual split-bundle lookup failures
  • add an admin API regression test to verify FLOW_OR_QPS_EQUALLY_DIVIDE no longer fails when the default split algorithm is different
  • add an extensible load manager regression test to verify the no-boundary case does not fail and leaves the bundle layout unchanged

Verifying this change

  • Make sure that the change passes the CI checks.

(Please pick either of the following options)

This change is a trivial rework / code cleanup without any test coverage.

(or)

This change is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(example:)

  • Added integration tests for end-to-end deployment with large payloads (10MB)
  • Extended integration test for recovery after broker failure

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

Matching PR in forked repository

PR in forked repository: Denovo1998#25

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes manual namespace bundle split behavior when using the flow_or_qps_equally_divide algorithm, ensuring the requested algorithm drives option construction and making the extensible load manager (ELM) treat “no valid split boundary” as a successful no-op instead of a misleading “bundle not found” failure.

Changes:

  • Build BundleSplitOption based on the requested split algorithm (avoids ClassCastException for flow_or_qps_equally_divide).
  • In ELM split flow, treat “no valid boundary” as a no-op success and keep “bundle not found” only for real lookup failures.
  • Add regression tests covering the requested-algorithm path and the ELM no-boundary no-op behavior.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
pulsar-broker/src/main/java/org/apache/pulsar/broker/namespace/NamespaceService.java Constructs split options based on the requested algorithm (not default config), preventing incorrect option types.
pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/extensions/ExtensibleLoadManagerImpl.java Adjusts ELM bundle split to no-op on empty/null boundaries and only error on actual split-bundle lookup failures.
pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminApiTest.java Adds regression test ensuring FLOW_OR_QPS requested algorithm doesn’t fail when default algorithm differs.
pulsar-broker/src/test/java/org/apache/pulsar/broker/loadbalance/extensions/ExtensibleLoadManagerImplTest.java Adds regression test ensuring ELM path no-valid-boundary case succeeds and leaves bundle layout unchanged.

@Denovo1998
Copy link
Copy Markdown
Contributor Author

The current CI runs really fast. Still stable!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc-not-needed Your PR changes do not impact docs ready-to-test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants