Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

DirectToKRaftControllerQuorumIf Received by BrokerIf Received by KRaft Controller
falsetraditional broker MetadataResponseUNSUPPORTED_VERSION MetadataResponse
trueNOTINVALID_CONTROLLER REQUEST MetadataResponsecontroller MetadataResponse described below

...

If any of them are set to true, an INVALID_REQUEST MetadataResponse will be returned.Topics must be set to an empty array, indicating no interest in any topics

The controller will return information about the specified topics, or about all topics if requested.

KRaft Controller MetadataResponse

...

Response typeTopics Section"Brokers" SectionComments
Successful response from KRaft controlleremptyThe topic data, if any was requested.Controller endpoint information as given in controller.quorum.voters The "direct to controller" case.
Error response from if topics were given in requestthe given topics, with an INVALID_REQUEST error for eachthe expected error codeEmptyIt is an error to ask about specific topics.
Error response if no topics were given in requestthe __cluster_metadata topic with the expected error codeEmptyThere is no top-level error code in MetadataResponse, so we use the __cluster_metadata topic to send back our error.

...

Another issue is that in the future, we may want to support using the controllers as bootstrap servers for the brokers. The scheme above leaves the door open for this, whereas a scheme that reused existing configurations would not. 

Future Work

In the future, we might want to allow the controllers to be used as bootstrap servers for the broker. This would be helpful, for example, in cases where a plugin running on the controller itself wanted to create a consumer or producer, without hard-coding broker addresses in the configuration.

This is a separate use-case from the direct-to-controller one, so probably needs different configuration.

One major problem is what broker endpoints to return. Perhaps we could always return the inter-broker endpoints in the response. However, it's unclear how the client should proceed when the controller has different security settings than the selected broker endpoints. This might require more complex client configuration.