xiangfu0 commented on code in PR #12175:
URL: https://github.com/apache/pinot/pull/12175#discussion_r1431997929
##########
pinot-broker/src/main/java/org/apache/pinot/broker/broker/helix/BaseBrokerStarter.java:
##########
@@ -439,17 +440,26 @@ private void
updateInstanceConfigAndBrokerResourceIfNeeded() {
}
updated |= HelixHelper.removeDisabledPartitions(instanceConfig);
boolean shouldUpdateBrokerResource = false;
- String brokerTag = null;
List<String> instanceTags = instanceConfig.getTags();
if (instanceTags.isEmpty()) {
// This is a new broker (first time joining the cluster)
if (ZKMetadataProvider.getClusterTenantIsolationEnabled(_propertyStore))
{
- brokerTag = TagNameUtils.getBrokerTagForTenant(null);
+ instanceConfig.addTag(TagNameUtils.getBrokerTagForTenant(null));
shouldUpdateBrokerResource = true;
} else {
- brokerTag = Helix.UNTAGGED_BROKER_INSTANCE;
+ String instanceTagsConfig =
_brokerConf.getProperty(Broker.CONFIG_OF_BROKER_INSTANCE_TAGS);
+ if (StringUtils.isNotEmpty(instanceTagsConfig)) {
+ for (String instanceTag : StringUtils.split(instanceTagsConfig,
',')) {
+ Preconditions.checkArgument(TagNameUtils.isBrokerTag(instanceTag),
"Illegal broker instance tag: %s",
+ instanceTag);
+ instanceConfig.addTag(instanceTag);
Review Comment:
Considering this comes from a config file, shall we do `instanceTag.trim()`?
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]