-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[fix][broker] fix null lookup result when brokers are starting #23642
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
Conversation
|
/pulsarbot rerun-failure-checks |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #23642 +/- ##
============================================
+ Coverage 73.57% 74.32% +0.75%
- Complexity 32624 34986 +2362
============================================
Files 1877 1944 +67
Lines 139502 147236 +7734
Branches 15299 16248 +949
============================================
+ Hits 102638 109439 +6801
- Misses 28908 29340 +432
- Partials 7956 8457 +501
Flags with carried forward coverage won't be shown. Click here to find out more.
|
pulsar-broker/src/main/java/org/apache/pulsar/broker/lookup/TopicLookupBase.java
Outdated
Show resolved
Hide resolved
pulsar-broker/src/main/java/org/apache/pulsar/broker/lookup/TopicLookupBase.java
Outdated
Show resolved
Hide resolved
lhotari
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, added minor comments about improving added log messages.
@poorbarcode I have one question: One of the goals of #22977 was to prevent serving requests before the broker is initialized. Did the broker version that you investigated contain this change?
Yes, it contains. We build the package with the latest version of BTW, I think #22977 should have already solved the current issue, let's keep tracing the issue by the new log this PR added. |
lhotari
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some typos to fix in the log messages.
pulsar-broker/src/main/java/org/apache/pulsar/broker/lookup/TopicLookupBase.java
Outdated
Show resolved
Hide resolved
pulsar-broker/src/main/java/org/apache/pulsar/broker/lookup/TopicLookupBase.java
Outdated
Show resolved
Hide resolved
…picLookupBase.java Co-authored-by: Lari Hotari <lhotari@users.noreply.github.com>
…picLookupBase.java Co-authored-by: Lari Hotari <lhotari@users.noreply.github.com>
Sorry for that. Fixed |
(cherry picked from commit bd3b3b8)
(cherry picked from commit bd3b3b8)
(cherry picked from commit bd3b3b8)
| boolean tlsEnabled = pulsar.getConfig().isBrokerClientTlsEnabled(); | ||
| if (!tlsEnabled && StringUtils.isBlank(lookupData.getBrokerUrl())) { | ||
| log.warn("[{}] Unexpected lookup result: brokerUrl is required when TLS isn't enabled. options: {}," | ||
| + " result {}", topic, options, lookupData); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems not make sense. brokerClientTlsEnabled only represents if TLS is enabled for built-in client.
Motivation
Issue
OwnershipCache.selfOwnerInfoOwnershipCache.selfOwnerInfois in the methodPulsarService.start()as bellowstartNamespaceService(): this line created the objectOwnershipCache, but the variableOwnershipCache.selfOwnerInfowill be set an empty value due toPulsarService.brokerServiceUrlhas not been initialized yet.PulsarService.brokerServiceUrl.OwnershipCache.selfOwnerInfois still empty, so the client may get a null responsensService.initialize(): reset the variable ofOwnershipCache.selfOwnerInfo.Error logs
Heap dump
OwnershipCache.selfOwnerInfowill be reset, butOwnershipCache.selfOwnerInfoDisablednever be set again.Modifications
OwnershipCache.selfOwnerInfobefore starting the Load Manager.Documentation
docdoc-requireddoc-not-neededdoc-completeMatching PR in forked repository
PR in forked repository: x