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

[fix][broker] Fix broker not starting when both transactions and the Extensible Load Manager are enabled #22139

Merged
merged 14 commits into from
Feb 28, 2024

Conversation

dragosvictor
Copy link
Contributor

@dragosvictor dragosvictor commented Feb 28, 2024

Motivation

Attempting to enable both the transaction coordinator (TC) and the Extensible Load Manager (ELM) leads brokers to fail on startup. The ELM is initialized before the TC, which causes a null pointer exception to be thrown when creating (here) or subscribing (here) to service unit state topic persistent://pulsar/system/loadbalancer-service-unit-state.

Modifications

Disable transactions for the respective topic, as it is an internal topic not meant to be part of any transaction.

Verifying this change

  • Make sure that the change passes the CI checks.

This change added tests and can be verified as follows:

  • Added integration tests org.apache.pulsar.tests.integration.messaging.MessagingSmokeTest validating messaging functionality still works when the ELM only is enabled, and when both the ELM and TC are enabled. The test can be easily extended to add more broker configuration combinations. Note that it takes around 9 minutes to run one combination. This test could be a candidate for a lower-frequency test job. Suggestions welcome.
  • Added unit test ExtensibleLoadManagerImplWithTransactionCoordinatorTest#testUnloadAdminAPI to quickly validate that the broker can start with both features enabled and perform a basic API call into the ELM.

Does this pull request potentially affect one of the following parts:

If the box was checked, please highlight the changes

  • Dependencies (add or upgrade a dependency)
  • The public API
  • The schema
  • The default values of configurations
  • The threading model
  • The binary protocol
  • The REST endpoints
  • The admin CLI options
  • The metrics
  • Anything that affects deployment

Documentation

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

Matching PR in forked repository

PR in forked repository: https://github.com/dragosvictor/pulsar/pull/14/files

@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Feb 28, 2024
@dragosvictor dragosvictor marked this pull request as ready for review February 28, 2024 06:41
Copy link
Member

@lhotari lhotari left a comment

Choose a reason for hiding this comment

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

Approved. The discussion was summarized in the comment #22139 (comment)

@heesung-sn heesung-sn added the type/bug The PR fixed a bug or issue reported a bug label Feb 28, 2024
@heesung-sn heesung-sn changed the title [improve][broker] Fix broker not starting when both transactions and the Extensible Load Manager are enabled [fix][broker] Fix broker not starting when both transactions and the Extensible Load Manager are enabled Feb 28, 2024
@heesung-sn heesung-sn added this to the 3.3.0 milestone Feb 28, 2024
@heesung-sn heesung-sn merged commit 3b3c713 into apache:master Feb 28, 2024
62 of 64 checks passed
@dragosvictor dragosvictor deleted the fix-elb-transaction-coordinator branch February 28, 2024 23:57
@heesung-sn
Copy link
Contributor

heesung-sn commented Feb 29, 2024

@dragosvictor We have a conflict in branch-3.0. Can you help to raise cherry-pick PRs for 3.0/3.1/3.2 branches?

dragosvictor added a commit to dragosvictor/pulsar that referenced this pull request Mar 1, 2024
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.

4 participants