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 migration NPE while broker tls url not configured #23534

Merged
merged 1 commit into from
Nov 1, 2024

Conversation

rdhabalia
Copy link
Contributor

@rdhabalia rdhabalia commented Oct 31, 2024

PIP: #16551

Motivation

Currently, cluster migration fails while creating migration-redireaction command if brokerUrlsTls doesn't exist and broker fails to send redirection command. Therefore, broker should handle null value for brokerUrl/brokerUrlTls while preparing the command.

2024-10-30T22:06:02,653-0700 [pulsar-client-io-1-7] WARN  org.apache.pulsar.client.impl.ClientCnx - [localhost/127.0.0.1:6650] Got exception java.lang.IllegalStateException: Field 'brokerServiceUrlTls' is not set
	at org.apache.pulsar.common.api.proto.CommandTopicMigrated.getBrokerServiceUrlTls(CommandTopicMigrated.java:130)
	at org.apache.pulsar.client.impl.ClientCnx.handleTopicMigrated(ClientCnx.java:714)

Modifications

This fix will allow cluster migration even if it doesn't have brokerUrlTls configured.

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

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:

@rdhabalia rdhabalia added area/broker doc-not-needed Your PR changes do not impact docs ready-to-test labels Oct 31, 2024
@rdhabalia rdhabalia added this to the 4.1.0 milestone Oct 31, 2024
@rdhabalia rdhabalia self-assigned this Oct 31, 2024
@codecov-commenter
Copy link

codecov-commenter commented Oct 31, 2024

Codecov Report

Attention: Patch coverage is 85.71429% with 2 lines in your changes missing coverage. Please review.

Project coverage is 74.34%. Comparing base (bbc6224) to head (78fc7fe).
Report is 705 commits behind head on master.

Files with missing lines Patch % Lines
.../java/org/apache/pulsar/client/impl/ClientCnx.java 83.33% 0 Missing and 1 partial ⚠️
...va/org/apache/pulsar/common/protocol/Commands.java 83.33% 0 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #23534      +/-   ##
============================================
+ Coverage     73.57%   74.34%   +0.77%     
- Complexity    32624    34956    +2332     
============================================
  Files          1877     1943      +66     
  Lines        139502   147050    +7548     
  Branches      15299    16209     +910     
============================================
+ Hits         102638   109331    +6693     
- Misses        28908    29300     +392     
- Partials       7956     8419     +463     
Flag Coverage Δ
inttests 27.42% <0.00%> (+2.84%) ⬆️
systests 24.32% <0.00%> (+<0.01%) ⬆️
unittests 73.74% <85.71%> (+0.89%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...rg/apache/pulsar/broker/service/AbstractTopic.java 87.91% <100.00%> (-0.08%) ⬇️
.../java/org/apache/pulsar/client/impl/ClientCnx.java 73.43% <83.33%> (+1.66%) ⬆️
...va/org/apache/pulsar/common/protocol/Commands.java 90.81% <83.33%> (+0.21%) ⬆️

... and 651 files with indirect coverage changes

@lhotari lhotari merged commit 6bd0308 into apache:master Nov 1, 2024
57 of 60 checks passed
@rdhabalia rdhabalia deleted the blue_fix branch November 1, 2024 19:48
visxu pushed a commit to vissxu/pulsar that referenced this pull request Nov 6, 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.

3 participants