Jackie-Jiang commented on code in PR #12175:
URL: https://github.com/apache/pinot/pull/12175#discussion_r1432006745
##########
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:
Initially I did add `trim()`, but then decided to remove it to keep it
consistent with `PinotHelixResourceManager.updateInstanceTags()`.
If we find people making mistakes frequently, we can consider changing both
to use `trim()`. Currently we don't have a check that tag cannot start/end with
space, so this might cause backward-incompatible
--
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]