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

Compare with Current View Page History

Version 1 Next »

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: Under Discussion

Discussion thread: here

JIRA: KAFKA-10230

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

Motivation

Currently Kafka Producer is able to identify unavailable partitions and avoid routing messages to them, but the definition of an unavailable partitions is - the leader of the partition is not available, this may have covered most of the cases to avoid unnecessary network calls etc.

From Producer point of view, to successfully transmit a message may require certain number of acks to be responded from the cluster. When the acks of Producer is set to all, partition leader availability is not able to define if a partition is ready/available to accept requests, Producer also needs to know if there are enough in-sync replicas in the cluster. 

By exposing the min.insync.replicas of each Kafka topic to Producer, we could potentially avoid exhausting the entire Producer buffer and unnecessary network calls when a partition does not have enough in-sync replicas in the cluster and new replication may take a while to complete (partition is too large).

Public Interfaces

MetadataResponse

Add one more property called minInSyncReplicas to the TopicMetadata class that located in MetadataResponse class.

MetadataReponse.TopicMetadata
public static class TopicMetadata {
    private final Errors error;
    private final String topic;
    private final boolean isInternal;
    private final List<PartitionMetadata> partitionMetadata;
    private int authorizedOperations;
    private int minInSyncReplicas;
}
MetadataResponseTopic.SCHEMA_10
Add one more field min_insync_replicas to the MetadataResponseTopic response and bump up the version.
MetadataResponseTopic.SCHEMA_10
public static final Schema SCHEMA_10 =
    new Schema(
        new Field("error_code", Type.INT16, "The topic error, or 0 if there was no error."),
        new Field("name", Type.COMPACT_STRING, "The topic name."),
        new Field("is_internal", Type.BOOLEAN, "True if the topic is internal."),
        new Field("partitions", new CompactArrayOf(MetadataResponsePartition.SCHEMA_9), "Each partition in the topic."),
        new Field("topic_authorized_operations", Type.INT32, "32-bit bitfield to represent authorized operations for this topic."),
        new Field("min_insync_replicas", Type.INT16, "min.insync.replicas of this topic."),
        TaggedFieldsSection.of(
        )
    );
Partitioner

A public interface is any change to the following:

  • Binary log format

  • The network protocol and api behavior

  • Any class in the public packages under clientsConfiguration, especially client configuration

    • org/apache/kafka/common/serialization

    • org/apache/kafka/common

    • org/apache/kafka/common/errors

    • org/apache/kafka/clients/producer

    • org/apache/kafka/clients/consumer (eventually, once stable)

  • Monitoring

  • Command line tools and arguments

  • Anything else that will likely break existing users in some way when they upgrade

Proposed Changes

Describe the new thing you want to do in appropriate detail. This may be fairly extensive and have large subsections of its own. Or it may be a few sentences. Use judgement based on the scope of the change.

Compatibility, Deprecation, and Migration Plan

  • What impact (if any) will there be on existing users?
  • If we are changing behavior how will we phase out the older behavior?
  • If we need special migration tools, describe them here.
  • When will we remove the existing behavior?

Rejected Alternatives

If there are alternative ways of accomplishing the same thing, what were they? The purpose of this section is to motivate why the design is the way it is and not some other way.

  • No labels