...
We propose a protocol upgrade to CreateTopicsRequest
and CreatePartition
s
Request
to specify a minimum number of replicas to be available at creation to satisfy the request.
A new error code will be added to indicate a topic/partition creation was completed without the full replication factor.
Abroker configuration will be added to select the desired behavior when brokers are missing from the cluster and the user allowed creation with less replicas than the full list. Administrators can disallow or allow creations of topics/partitions without the full replication factor or to allow and select. . Another option is to prefer using all known racks (and have some under replication) than immediately using online brokers.
Topic policies could be used to add more complex validations, for exampleto allow creation with min-isr factor but not less.
...
Code Block |
---|
CreatePartitionsResponse (Version: 2) //same schema as version 1 |
Error Codes
ERROR | CODE | RETRIABLE | DESCRIPTION |
CREATED_UNDER_REPLICATED | 79 | False | The server createda topic or partitions without the full set of replicas being active. |
Code Block |
---|
|
package org.apache.kafka.common.protocol;
public enum Errors {
...
CREATED_UNDER_REPLICATED(79, "The server created a topic or partitions without the full set of replicas being active.",
CreatedUnderReplicatedException::new);
} |
...
Code Block |
---|
language | java |
---|
title | NewPartition |
---|
|
// Keep existing factory methods and add a getter/setter pair (like NewTopic)
// to specify the minimum required replication factor if different from full
package org.apache.kafka.clients.admin;
public class NewPartition {
....
// return `this` for chaining
public NewPartition minRequiredReplicationFactor(short requiredReplicationFactor) {}
public short minRequiredReplicationFactor() {}
} |
Broker Configuration
NAME | DESCRIPTION | TYPE | DEFAULT | VALID VALUES | IMPORTANCE | DYNAMIC UPDATE MODE |
under.replicated.creation.enable | Allow Topic or Partition creation without the full set of replicas being active. | BOOLEAN | False | True/False | Medium | cluster-wide |
Command line tools and arguments
...