-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
get function cluster from broker config when start function worker with broker #10552
get function cluster from broker config when start function worker with broker #10552
Conversation
ac851c7
to
5aeadd7
Compare
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.
we also have to add some unit tests about this change
@@ -1515,6 +1515,7 @@ public static WorkerConfig initializeWorkerConfigFromBrokerConfig(ServiceConfigu | |||
String hostname = ServiceConfigurationUtils.getDefaultOrConfiguredAddress( | |||
ServiceConfigurationUtils.getAppliedAdvertisedAddress(brokerConfig)); | |||
workerConfig.setWorkerHostname(hostname); | |||
workerConfig.setPulsarFunctionsCluster(brokerConfig.getClusterName()); |
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.
what about setting this brokerConfig.getClusterName()
value only if the user did not configure another value ?
otherwise this change may introduce a behaviour change
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 user configure another value different with brokerConfig.getClusterName() , broker will fail to start, refer to #2328.
To avoid this to happen, we could force the value same with brokerConfig.getClusterName().
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
if it looks like it is useless to set a value explicitly if you cannot change it |
@eolivelli I have modify exist test case to meet this change, please have a check
Currently default value of FunctionsCluster is loaded from |
/pulsarbot run-failure-checks |
1 similar comment
/pulsarbot run-failure-checks |
@eolivelli please review this. |
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
/pulsarbot run-failure-checks |
2 similar comments
/pulsarbot run-failure-checks |
/pulsarbot run-failure-checks |
997f0d3
to
06fcb16
Compare
…th broker (apache#10552) ### Motivation When start function worker with broker, we need to set pulsarFunctionsCluster in functions_worker.yml, other wise it will fail to start. apache#2328 If we run broker in k8s, we should set correct config map to change the default value in functions_worker.yml. In this mode, pulsarFunctionsCluster should always be same with the cluster name in broker.conf, so we can get the setting directly from broker.conf. ### Modifications get function cluster from broker config when start function worker with broker
…th broker (apache#10552) ### Motivation When start function worker with broker, we need to set pulsarFunctionsCluster in functions_worker.yml, other wise it will fail to start. apache#2328 If we run broker in k8s, we should set correct config map to change the default value in functions_worker.yml. In this mode, pulsarFunctionsCluster should always be same with the cluster name in broker.conf, so we can get the setting directly from broker.conf. ### Modifications get function cluster from broker config when start function worker with broker
Motivation
When start function worker with broker, we need to set pulsarFunctionsCluster in functions_worker.yml, other wise it will fail to start. #2328
If we run broker in k8s, we should set correct config map to change the default value in functions_worker.yml.
In this mode, pulsarFunctionsCluster should always be same with the cluster name in broker.conf, so we can get the setting directly from broker.conf.
Modifications
get function cluster from broker config when start function worker with broker