Versions Compared

Key

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

Table of Contents

Status

Current stateWIPDiscuss

Discussion thread: here

JIRA

Motivation

In Kafka, there is no general mechanism to change entity configuration without doing a rolling restart of the entire cluster. Currently, only topic configs can be changed dynamically. This proposal attempts to build a unified mechanism for modeling configuration across various entities within Kafka i.e. topics, clients etc.

...

Code Block
There should be 43 paths within config
/config/clients/<client_id>
/config/topics/<topic_name>
/config/brokers/<broker_id>

Internally, the znodes are comma-separated key-value pairs where key represents the configuration to change.
{"version": x, "config" : {X1=Y1, X2=Y2..}}

 

Upon startup, all brokers will load all the configs from zookeeper. In order to receive notifications, it's undesirable to watch every path under the root config directory. We can model change notifications the same way as they are currently handled for topic based configs. Here is the workflow for changing or adding a config of any type:

...

Configs in Zookeeper take precedence over any configuration read from the properties file. There is currently no plan to move away from file based configuration for service configs.

Applying

...

The ZK listener can have a reference to KafkaConfig or the properties object which was used to start the KafkaServer. Anytime a change notification is received, we should do the following:

  1. Parse received notification into a properties object.
  2. Within KafkaConfig, for each newly changed property, verify that it can be changed dynamically. For this, ConfigDef needs to expose a getConfigKey() method that can be used to check the isDynamic flag. If a property cannot be updated, log a warning and move on.

All configs should always be accessed via a reference to KafkaConfig. For this, all subsystems within the broker need to be configured with a config object and not individual config values.

...

Client Config Changes

The first usecase for client configs it to process quota changes per-client. This class will process all notifications and change quotas accordingly. This also requires some metrics package changes to allow modification of quotas. Producer and consumer quotas are distinguished by having different keys since it's possible for a producer and consumer to have the same client id.

The client znode will look like this:

Code Block
{"version" : 1, "config" : {producer-byte-rate=X1, consumer-byte-rate=X2}}

 

Config Change Notification

Currently, the change notification znode only contains the topic name. We need to add more information to distinguish whether this config change is for a topic, client or broker config. We need to distinguish producers and consumers separately because it is possible for a producer and consumer to have the same clientIdother config. Version numbering should also be added.

Code Block
The notification data can be:
{"version" : 1, "entity":"topic/producer/consumer/brokerclient", "value" : "topic_name/client_id/broker_id"}

Compatibility, Deprecation, and Migration Plan

  • TopicConfigManager has a config_change_XX sequential znode under configs/. The format of data within the config_change node is going to change hence it is important to not make any config changes using AdminTools until the cluster is fully upgraded. 

Rejected Alternatives

Broker Configs: