Versions Compared

Key

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

Table of Contents


Status

Current state[One of "Under Discussion", "Accepted", "Rejected"]

Discussion thread: Under Discussion

JIRA: here

Motivation

The configuration can be applied at the topic, broker, or cluster level. However, our primary concern is the behavior of topics, or ensuring that topics operate consistently across the cluster, rather than expecting the same topic to behave differently on different brokers. For example, if there are two brokers with different settings for min.insync.replicas, moving a leader to a different broker would change its behavior with respect to the min.insync.replicas semantics.

This KIP aims to enforce that the proposed configurations have the same cluster-level settings and disallow them from being set at the broker level, ensuring consistent behavior across the cluster.

Public Interfaces

Proposed Configurations to Enforce:

  1. min.insync.replicas
  2. unclean.leader.election.enable
  3. message.max.bytes
  4. log.message.timestamp.type
  5. log.cleanup.policy

Behavior/Admin API Changes

  • On the cluster's first startup, initialize proposed configurations at the cluster level with their static default values.
  • Disallow setting these configurations at the broker level via the incrementalAlterConfigs API or the deprecated AlterConfigs API. The new error, DISALLOWED_BROKER_LEVEL_CONFIG_ERROR, will be returned if such requests are made.
  • Disallow removing these configurations at the cluster level via the incrementalAlterConfigs API or the deprecated AlterConfigs API. The new error, DISALLOWED_CLUSTER_LEVEL_CONFIG_REMOVAL_ERROR, will be returned if such requests are made.
  • When upgrading to a version that includes this KIP, any proposed configurations at the broker level will be removed. For cluster level, if they are not set, they will be initialized to their default values. The default values are the static configs.

New Errors

  • DISALLOWED_BROKER_LEVEL_CONFIG_ERROR
  • DISALLOWED_CLUSTER_LEVEL_CONFIG_REMOVAL_ERROR

Proposed Changes

Cluster's first startup

On the cluster's first startup, initialize the proposed configurations at the cluster level. Since dynamic configs have higher priority, any corresponding static broker configs will not take effect.

incrementalAlterConfigs and the deprecated AlterConfigs APIs

Disallow setting the proposed configurations at the broker level and removal of proposed configurations at the cluster level. The corresponding new errors will be thrown if this kind of requests are received.

Upgrade

When using the updateFeatures API to upgrade to a version that includes this KIP change:

  • Any proposed broker-level configurations will be removed.
  • If the cluster-level configurations are not set, default values will be applied.

New enum structure

Specifically, introduce a new enum GuardedBrokerConfig that includes the proposed configurations and helper methods to keep the code concise and extensible.

Code Block
languagejava
titleGuardedBrokerConfig.java
public enum GuardedBrokerConfig {
    MIN_IN_SYNC_REPLICAS(MIN_IN_SYNC_REPLICAS_CONFIG, ConfigDef.Type.INT),
    UNCLEAN_LEADER_ELECTION_ENABLE(UNCLEAN_LEADER_ELECTION_ENABLE_CONFIG, ConfigDef.Type.BOOLEAN),
    MESSAGE_MAX_BYTES(MESSAGE_MAX_BYTES_CONFIG, ConfigDef.Type.INT),
    LOG_MESSAGE_TIMESTAMP_TYPE(LOG_MESSAGE_TIMESTAMP_TYPE_CONFIG, ConfigDef.Type.STRING),
    LOG_CLEANUP_POLICY(LOG_CLEANUP_POLICY_CONFIG, ConfigDef.Type.STRING);
	
    // ... remaining methods ... //
}


Compatibility, Deprecation, and Migration Plan

  • For the incrementalAlterConfigs and AlterConfigs APIs, any disallowed requests will be rejected and immediately throw an error. This may break user applications.

  • On upgrade, any broker-level settings for the proposed configurations will be removed. This may break users who set these configs at the broker level.

Test Plan

The typical suite of unit/integration tests will be added.

Rejected Alternatives

1. Disallow alter API reqeusts with warnings and ignore setting

...