lhotari commented on a change in pull request #14078:
URL: https://github.com/apache/pulsar/pull/14078#discussion_r799578634
##########
File path:
pulsar-proxy/src/main/java/org/apache/pulsar/proxy/server/ProxyConnection.java
##########
@@ -481,6 +504,36 @@ public HAProxyMessage getHAProxyMessage() {
return haProxyMessage;
}
- private static final Logger LOG =
LoggerFactory.getLogger(ProxyConnection.class);
+ private boolean isBrokerActive(String targetBrokerHostPort) {
+ for (ServiceLookupData serviceLookupData : getAvailableBrokers()) {
+ if (matchesHostAndPort("pulsar://",
serviceLookupData.getPulsarServiceUrl(), targetBrokerHostPort)
+ || matchesHostAndPort("pulsar+ssl://",
serviceLookupData.getPulsarServiceUrlTls(),
+ targetBrokerHostPort)) {
+ return true;
+ }
+ }
+ return false;
+ }
+ private List<? extends ServiceLookupData> getAvailableBrokers() {
+ if (service.getDiscoveryProvider() == null) {
+ LOG.warn("Unable to retrieve active brokers.
service.getDiscoveryProvider() is null."
+ + "zookeeperServers and configurationStoreServers must be
configured in proxy configuration "
+ + "when checkActiveBrokers is enabled.");
+ return Collections.emptyList();
+ }
Review comment:
> @lhotari Fail-fast is good, though the current issue is that
`checkActiveBrokers=true` by default will break all upgrades in proxies where
`zookeeperServers` is not set (which I expect to be the majority).
@merlimat I have addressed this now. PTAL
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]