pinot icon indicating copy to clipboard operation
pinot copied to clipboard

Pinot Broker Uses a Generic "instanceId" Property Which is Shared With Minion

Open ankitsultana opened this issue 3 years ago • 0 comments

At present BaseBrokerStarter determines the Broker Instance ID using a very generic "instanceId" property which is also shared with Pinot minion. In the case of a Quickstart Cluster, if we want to start the Broker with a particular instanceId the start-up fails since the same property is used by the Minion as well.

I think we can change this logic to the following (use pinot.broker.id over instanceId):

    _instanceId = _brokerConf.getProperty(Broker.CONFIG_OF_BROKER_ID);
    if (_instanceId == null && _brokerConf.getProperty(Helix.Instance.INSTANCE_ID_KEY) != null) {
        _instanceId = _brokerConf.getProperty(Helix.Instance.INSTANCE_ID_KEY);
    }
    if (_instanceId != null) {
      // NOTE: Force all instances to have the same prefix in order to derive the instance type based on the instance id
      Preconditions.checkState(InstanceTypeUtils.isBroker(_instanceId), "Instance id must have prefix '%s', got '%s'",
          Helix.PREFIX_OF_BROKER_INSTANCE, _instanceId);
    } else {
      _instanceId = Helix.PREFIX_OF_BROKER_INSTANCE + _hostname + "_" + _port;
    }

    _brokerConf.setProperty(Broker.CONFIG_OF_BROKER_ID, _instanceId);

https://github.com/apache/pinot/blob/53c117f50194754aec3ecbcae0e065d0901c0712/pinot-broker/src/main/java/org/apache/pinot/broker/broker/helix/BaseBrokerStarter.java#L136:L145

ankitsultana avatar Aug 28 '22 20:08 ankitsultana