You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Status

Current state: Draft

Discussion thread: TODO

JIRA: TODO

Please keep the discussion on the mailing list rather than commenting on the wiki (wiki discussions get unwieldy fast).

Motivation

Quota management via Admin Client has gone through a couple drafts of proposals (see KIP-248, KIP-422). The common ulterior motive is to remove ZooKeeper from this interaction for a variety of reasons (see KIP-500), notwithstanding validation, security, and future extensibility. The goal of this KIP is to provide minimal interface changes to achieve this by leveraging use of existing configuration mechanisms, but also convey as much useful information as possible.

Public Interfaces + Proposed Changes

(1) Quota should be modifiable via Admin::incrementalAlterConfigs().

The signature would not change:

incrementalAlterConfigs(Map<ConfigResource>, Collection<AlterConfigOp>>)

However, the ConfigResource object would have to be adapted to handle user, client, and user+client configurations. Therefore, enum values must be added for USER and CLIENT, however, this isn't sufficient for specifying a user+client configuration. There are two options to do so.

  1. Add a combination USER_CLIENT type, with a delimiter in the name to separate user from client. The problem is that the user and client will have to be escaped since they're opaque, and therefore a special constructor must be added. Or,
  2. Add a child ConfigResource field, where the only valid configuration relationship would be a parent resource type USER with a child type CLIENT.

Option (1) has the advantage that the wire protocol doesn't need to be modified, and the formed name can be exactly like that path in ZooKeeper today (user/clients/client). A generic parent-child hierarchy is unlikely to be useful long-term.

public final class ConfigResource {
    public enum Type {
        USER_CLIENT((byte) 48), CLIENT((byte) 32), USER((byte) 16), BROKER_LOGGER((byte) 8), BROKER((byte) 4), TOPIC((byte) 2), UNKNOWN((byte) 0);
        ...
    }

    public ConfigResource(Type type, String name) {
      // assert `type` is not `USER_CLIENT`
      ...
    }

    public static ConfigResource makeUserClient(String user, String client) {
      // `user` and `client` are "sanitized" together
    }
}

On the server side, incrementAlterConfigs would be updated to accept these new resource types, and would perform the expected configuration update in ZooKeeper.

(2) Quotas should be describable via describeConfigs().





Compatibility, Deprecation, and Migration Plan


Rejected Alternatives


  • No labels