-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[PIP 95][Issue 12040][broker] Improved multi-listener in standalone mode #12066
[PIP 95][Issue 12040][broker] Improved multi-listener in standalone mode #12066
Conversation
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.
If I understand correctly this patch is part of a PIP that has not yet been approved.
Please do not merge.
It would be better to mark this patch as draft probably
@eolivelli that makes sense, though I must admit that this particular PR has no real connection. It is just a straight bug fix. Seem OK to you? |
.isRunningStandalone(); | ||
// url, if the advertised address is localhost (per PulsarStandaloneStarter). | ||
ServiceConfiguration conf = pulsarService.getConfiguration(); | ||
boolean isLocalhost = StringUtils.equals("localhost", conf.getAdvertisedAddress()); |
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.
In standalone mode, what if we set advertisedAddress
to 127.0.0.1?
Or the domain name host is set on the machine, but it points to the local.
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.
+1
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.
Java has an API in order to understand if the address is local, for instance we should support also IPv6 localhost addresses
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.
Good idea @315157973 and @eolivelli, I'll use InetAddress::isLoopbackAddress to test whether the advertised address is a loopback address, in which case we'll force the proxy mode (standalone only).
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.
I updated the code to use isLoopbackAddress
against the resolved LookupData
. The logic can be understood as "don't return a LookupData that is pointing to a loopback address; force a proxy mode in that case".
This is a new feature that should not go to 2.8 release line in my opinion. |
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.
PIP approved
LGTM
there is a conflict, can you please resolve it ? |
…alone # Conflicts: # pulsar-broker/src/main/java/org/apache/pulsar/PulsarStandalone.java
* up/master: (26 commits) [pulsar-admin] Allow setting --forward-source-message-property to false when updating a pulsar function (apache#12128) [website][upgrade]feat: docs migration - Development (apache#12320) Update delete inactive topic configuration documentation (apache#12350) [PIP 95][Issue 12040][broker] Multiple bind addresses for Pulsar protocol (apache#12056) Added Debezium Source for MS SQL Server (apache#12256) Fix: flaky oracle tests (apache#12306) [C++] Use URL encoded content type for OAuth 2.0 authentication (apache#12341) [C++] Handle OAuth 2.0 exceptional cases gracefully (apache#12335) feat(cli): add restart command to pulsar-daemon (apache#12279) [client-tools] Remove redundant initial value (apache#12296) Make AuthenticationTokenTest to run on windows (apache#12329) [offload] fix FileSystemManagedLedgerOffloader can not cleanup outdated ledger data (apache#12309) [Doc]--Update contents for Pulsar adaptor for Apache Spark (apache#12338) [PIP 95][Issue 12040][broker] Improved multi-listener in standalone mode (apache#12066) [website][upgrade]feat: docs migration - Cookbooks (apache#12319) [testclient] Make --payload-file take effect in PerformanceClient (apache#12187) [website][upgrade]feat: docs migration - adaptor (apache#12318) [pulsar-client] Add partition-change api for producer/consumer interceptors (apache#12287) [Transaction]Fix lowWaterMark of TopicTransactionBuffer (apache#12312) [pulsar-admin] New option takes precedence over deprecated option (apache#12260) ... # Conflicts: # site2/website-next/docusaurus.config.js # site2/website-next/versions.json
Master Issue: #12040
Related: #1152
Motivation
It should be possible to use the
advertisedListeners
configuration property in Pulsar standalone mode. One reason is to support dev scenarios involving multiple listeners. Another is to make standalone mode more consistent, e.g. to avoid special cases like seen here.Modifications
NoopLoadManager
to actually advertise the configured advertised listeners.advertisedAddress
is a loopback address.Verifying this change
This change is a trivial rework / code cleanup without any test coverage.
Does this pull request potentially affect one of the following parts:
If
yes
was chosen, please highlight the changesDocumentation
Check the box below and label this PR (if you have committer privilege).
Need to update docs?
no-need-doc
This PR addresses an undocumented limitation.