Versions Compared

Key

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

Table of Contents

Status

Current state: Under Discussion", Accepted

Discussion thread: https://lists.apache.org/thread/mbjlgbv2q4x5ml7mx93ls77bg93wtrfy

Vote thread: https://lists.apache.org/thread/czmbljctdkrl6s834gmrv4kwn8d6oq44Discussion thread

JIRA:

Jira
serverASF JIRA
serverId5aa69414-a9e9-3523-82ec-879b028fb15b
keyKAFKA-18786

...

Add nodeId to DescribeFeaturesOptions. Default value is -1empty.

Code Block
languagejava
linenumberstrue
public class DescribeFeaturesOptions extends AbstractOptions<DescribeFeaturesOptions> {
      private intOptionalInt nodeId = -1OptionalInt.empty();

    /**
     * Set the node id to which the request should be sent. If using bootstrap controller and node id is less than 0,
     * the request will be sent to the controller node. If using bootstrap broker and node id is less than 0, the
     * request will be sent to the first available node.
     */
    public DescribeFeaturesOptions nodeId(int nodeId) {
        this.nodeId = OptionalInt.of(nodeId);
        return this;
    }

    /**
     * The node id to which the request should be sent. If using bootstrap controller and the node id is less than 0,
     * empty, the request will be sent to the controller node. If using bootstrap broker and node id is less than 0, the
     * request will be sent to the first available nodearbitrary controller/broker.
     */
    public intOptionalInt nodeId() {
        return nodeId;
    }
}

...

  • Default DescribeFeaturesOptions can work as usual.

  • If nodeId is negativeempty, the Admin client ignores it and falls back to use LeastLoadedBrokerOrActiveKController.

  • If nodeId is valid, the Admin client sends ApiVersionRequest to a node with nodeId.

  • If nodeId is not registered, the Admin client throws TimeoutException.

kafka-features.sh

  • The empty —-node-id can work as usual.

  • If nodeId is negative, the FeatureCommand throws IllegalArgumentException.

  • If nodeId is valid, the FeatureCommand get gets ApiVersionResponse from a node with nodeId.

Rejected Alternatives

  • If nodeId is not registered, the FeatureCommand throws AdminCommandFailedException.

Alternatives

Use metrics to track finalized level and minimum / maximum supported level. The approach has been accepted in KIP-1180: Add generic feature level metrics.N/A