Skip to content

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

@ankitsultana

Description

@ankitsultana

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions