Slackbot
01/12/2024, 6:38 AMLari Hotari
01/12/2024, 7:39 AMLari Hotari
01/12/2024, 7:41 AMManmeet
01/12/2024, 11:50 AMLari Hotari
01/12/2024, 12:00 PMManmeet
01/12/2024, 12:34 PMLari Hotari
01/12/2024, 4:52 PMLari Hotari
01/12/2024, 5:06 PMadvertisedAddress=prod-xx-pulsar-broker-0
advertisedListeners=public_pulsar:<pulsar://xx.yy.zz.xy:6650>,public_http:<http://xx.yy.zz.xy:8080>,internal:<pulsar://prod-xx-pulsar-broker-0:6650>,internal:<http://prod-xx-pulsar-broker-0:8080>
internalListenerName=internal
I'm working on a fix to the problem. Please report the issue to https://github.com/apache/pulsar/issues in the mean time and test the workaround. That would be helpful. Thanks!Lari Hotari
01/13/2024, 1:24 AMGirish Sharma
01/13/2024, 6:49 AMManmeet
01/14/2024, 4:55 PMLari Hotari
01/14/2024, 7:40 PMbut we use the isolation group feature where our ns isolation group policy regex is based on broker hostname. just want to validate that there is no impact on that?@Girish Sharma Based on looking at the code, it doesn't look like isolation group feature is impacted.
Lari Hotari
01/14/2024, 7:41 PMGirish Sharma
01/30/2024, 6:05 PMadvertisedAddress: <pod-name>.<service-name>
advertisedListeners: XYZ:pulsar://<ip>:6650, XYZ:http://<ip>:80, internal:http://<pod-name>.<service-name>:80
internalListenerName=internalGirish Sharma
01/30/2024, 6:08 PMhttp protocol internal listener in the advertised listeners, that one gets being used as the "web url" everywhere in pulsar, and not just for internal load balancing.. i.e., in a lookup call when it has to return back with redirect, it would use that http://<pod-name>.<service-name>:80 as the prefix in the redirect url.
This basically makes the XYZ lisntner's http protocol IP based address useless..
This leads to failing lookup calls as clients are not able to resolve the redirect url as those k8s based addresses only resolve inside a cluster.Girish Sharma
01/30/2024, 6:09 PMlistenerName: XYZ during client creation.. but that might not be a feasible thing in every tech stack/connector..Girish Sharma
01/30/2024, 6:10 PMLari Hotari
01/30/2024, 9:54 PMhttp protocol internal listener in the advertised listeners, that one gets being used as the "web url" everywhere in pulsar, and not just for internal load balancing.. i.e., in a lookup call when it has to return back with redirect, it would use that http://<pod-name>.<service-name>:80 as the prefix in the redirect url.
>
> This basically makes the XYZ lisntner's http protocol IP based address useless..
> This leads to failing lookup calls as clients are not able to resolve the redirect url as those k8s based addresses only resolve inside a cluster.
It's a valid observation. There is definitely room for improvements as you are pointing out.
> the fix is that the clients (where possible) add a client configuration of listenerName: XYZ during client creation.. but that might not be a feasible thing in every tech stack/connector..
yes, this is a good point.
> by any chance, your PR fixes this situation?
The PR doesn't improve the advertised listener feature. It fixes the load manager's leader broker issue #21897.
> Why is an "internal" address being given out to clients..
I'm not sure why it has exactly been implemented this way. It is PIP-61 https://github.com/apache/pulsar/wiki/PIP-61%3A-Advertised-multiple-addresses . Checking the document , PRs and mailing list discussions and reference documentation might reveal more of the context. PIP-61 does mention "only return the corresponding service URL". Perhaps the implementation contains some TODOs. 🙂Girish Sharma
01/31/2024, 5:08 AMChecking the document , PRs and mailing list discussions and reference
documentation might reveal more of the context. PIP-61 does mention
"only return the corresponding service URL". Perhaps the implementation
contains some TODOs. 🙂I was thinking about it. I can't see a "fix" in the current approach. But I definitely think it shouldn't be the default behavior to send in the internal address back in the lookup call in case the client is missing the listener name.. but the only way to do that now is to introduce a broker property called
lookupListener which defines the name of the listener to be used for lookup if listenerName is missing from lookup call.Lari Hotari
01/31/2024, 9:12 AMlookupListener which defines the name of the listener to be used for lookup if listenerName is missing from lookup call.
+1. It also comes to mind that there could be a need to support multiple "listener" instances that bind to different server socket port ports so that a listener on a specific port could have a specific default listener. Obviously this would be a lot of additional complexity. I personally fear the way how things are configured. The configuration framework in Pulsar isn't great for hierarchical information which would be better off in yaml files or such. (sidenote: Migrating to https://github.com/gestalt-config/gestalt is something that I have been dreaming about. 🙂 Gestalt Config is very similar to Spring Boot's configuration solution without the coupling to Spring Framework and Spring Boot.)Girish Sharma
01/31/2024, 9:31 AMmultiple "listener" instances that bind to different server socket port ports so that a listener on a specific port could have a specific default listener.A per port thing might not cater to all use cases as there is an internal vs external address notation on the same port ..
Lari Hotari
01/31/2024, 9:48 AMA per port thing might not cater to all use cases as there is an internal vs external address notation on the same port ..The reason why I mentioned it is that I think that the per port solution would be necessary for implementing what PIP-61 mentions about "only return the corresponding service URL". It's not exclusive for the the default
lookupListener solution what you proposed.
Without a separate listener instance on a different port, it would be hard to distinguish between internal and external traffic. This is just my gut feeling.Girish Sharma
01/31/2024, 9:58 AMGirish Sharma
01/31/2024, 9:58 AMLari Hotari
01/31/2024, 10:15 AMGirish Sharma
01/31/2024, 10:16 AMLari Hotari
01/31/2024, 12:19 PMGirish Sharma
01/31/2024, 12:27 PMGirish Sharma
02/05/2024, 1:24 PMlistenerName (query param or header) is present in the incoming lookup call, whether it resuts in 200 or 307 redirect, there is one inconsistency today, here or at many places where LookupResult is created inside the if (options.hasAdvertisedListener()) block. The inconsistency is that while the pulsar: and pulsar+ssl: protocols urls in the response are chosen from the listernerName of the lookup request, the http and https protocols urls are still returned from the internal listener (or the first from the advertised listener if internal is not present/doesnt have the http scheme) ...
This should be consistent, right? all 4 protocol urls should be defined based on the lookup listener name.Girish Sharma
02/05/2024, 1:28 PMGirish Sharma
02/05/2024, 1:28 PMGirish Sharma
02/05/2024, 1:33 PMA secondary goal is to improve the interoperability of KOP by implementing smart endpoint selection for ordinary Kafka clients. This shall be based on the semantics of KIP-103 and is consistent with this proposal. Similarly for other protocol handlers.but KIP-103 clearly also brings in a
CLIENT listener which serves as all addresses needed for external communication...Lari Hotari
02/05/2024, 1:39 PMnow if we make this consistent, there may be backward incompatible result for users who are used to this inconsistency.. any thoughts here?It might require creating a PIP to cover the changes although it seems that it would be a bug fix. The benefit of a PIP is that it also serves as a design document for the changes. Would you like to start a drafting a PIP for this where the problem is described and then proposing possible solutions?
Girish Sharma
02/05/2024, 1:40 PMManmeet
02/07/2024, 6:45 PMManmeet
02/09/2024, 12:22 PMLari Hotari
02/09/2024, 1:12 PMLari Hotari
02/12/2024, 3:08 PMLari Hotari
02/12/2024, 3:09 PMGirish Sharma
02/12/2024, 3:12 PMLari Hotari
02/12/2024, 3:47 PMLari Hotari
02/12/2024, 3:47 PMLari Hotari
02/12/2024, 3:48 PMLari Hotari
02/12/2024, 3:59 PMLari Hotari
02/12/2024, 4:07 PM