Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Start on Motivation

Table of Contents

This page is meant as a template for writing a KIP. To create a KIP choose Tools->Copy on this page and modify with your content and replace the heading with the next KIP number and a description of your issue. Replace anything in italics with your own description.

Status

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

Discussion thread: here [Change the link from the KIP proposal email archive to your own email thread]

JIRA: : https://issues.apache.org/jira/browse/KAFKA-5693here [Change the link from KAFKA-1 to your own ticket]

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

Motivation

Kafka already has user configurable policies which can be used by a cluster administrator to limit how the cluster can be modified by non-administrator users using the AdminClient API:

  • TopicCreationPolicy can prevent a topic being created based on topic creation parameters (name, number of partitions & replication factor or replica assignments, topic configs)
  • AlterConfigPolicy can prevent a change to topic config (or, in theory, broker config, but it's current not possible to change broker configs via the AdminClient API)

As new APIs are added to the AdminClient we need to apply policies to them, but the existing policy interfaces make it difficult to do in a consistent way.

Example 1

Changing the number of partitions in a topic (KIP-195) is one kind of topic modification. Consider:

  • It shouldn't be possible to create a topic, but then modify it so that it no longer conforms to the TopicCreationPolicy.
  • An administrator who wants to prevent increasing the number of partitions entirely for topics with keys, because of the effect on partitioning.

So there needs to be a policy for modifying a topic in this way. But it is confusing and error-prone if there are different policy classes for creation and modification. So there should be a single policy interface which is applied to both topic creation and modification. We could apply the TopicCreationPolicy to modifications, but this would obscure whether a particular invocation of the policy was for a topic creation or modification (the second bullet). So we conclude we need a different policy than TopicCreationPolicy.

Example 2

Reassigning replicas is another kind of topic modification (KIP-179). By similar reasoning to example 1 it, too, should be covered by the same policy.

 

KIP-170 proposes a TopicDeletionPolicyDescribe the problems you are trying to solve.

Public Interfaces

Briefly list any new interfaces that will be introduced as part of this proposal or any existing interfaces that will be removed or changed. The purpose of this section is to concisely call out the public contract that will come along with this feature.

...