From 269e2d898b76b5c9c58232c35bee805ceacc2ead Mon Sep 17 00:00:00 2001 From: ClarkChen Date: Thu, 27 Feb 2025 16:05:24 +0800 Subject: [PATCH] KAFKA-18849 Add "strict min ISR" to the docs of "min.insync.replicas" (#19016) KIP-966 adds strict min ISR rule, so this PR improves the docs of min.insync.replicas to include that change. Reviewers: Ismael Juma , Chia-Ping Tsai --- .../org/apache/kafka/common/config/TopicConfig.java | 13 +++++++------ .../kafka/server/config/ServerLogConfigs.java | 10 +--------- 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/clients/src/main/java/org/apache/kafka/common/config/TopicConfig.java b/clients/src/main/java/org/apache/kafka/common/config/TopicConfig.java index fb51d254cdd..10d6024163b 100755 --- a/clients/src/main/java/org/apache/kafka/common/config/TopicConfig.java +++ b/clients/src/main/java/org/apache/kafka/common/config/TopicConfig.java @@ -173,12 +173,13 @@ public class TopicConfig { public static final String MIN_IN_SYNC_REPLICAS_DOC = "When a producer sets acks to \"all\" (or \"-1\"), " + "this configuration specifies the minimum number of replicas that must acknowledge " + "a write for the write to be considered successful. If this minimum cannot be met, " + - "then the producer will raise an exception (either NotEnoughReplicas or " + - "NotEnoughReplicasAfterAppend).
When used together, min.insync.replicas and acks " + - "allow you to enforce greater durability guarantees. A typical scenario would be to " + - "create a topic with a replication factor of 3, set min.insync.replicas to 2, and " + - "produce with acks of \"all\". This will ensure that the producer raises an exception " + - "if a majority of replicas do not receive a write."; + "then the producer will raise an exception (either NotEnoughReplicas or NotEnoughReplicasAfterAppend).
" + + "Regardless of the acks setting, the messages will not be visible to the consumers until " + + "they are replicated to all in-sync replicas and the min.insync.replicas condition is met.
" + + "When used together, min.insync.replicas and acks allow you to enforce greater durability guarantees. " + + "A typical scenario would be to create a topic with a replication factor of 3, " + + "set min.insync.replicas to 2, and produce with acks of \"all\". " + + "This will ensure that a majority of replicas must persist a write before it's considered successful by the producer and it's visible to consumers."; public static final String COMPRESSION_TYPE_CONFIG = "compression.type"; public static final String COMPRESSION_TYPE_DOC = "Specify the final compression type for a given topic. " + diff --git a/server-common/src/main/java/org/apache/kafka/server/config/ServerLogConfigs.java b/server-common/src/main/java/org/apache/kafka/server/config/ServerLogConfigs.java index fa7ed93850f..ac11be948ad 100644 --- a/server-common/src/main/java/org/apache/kafka/server/config/ServerLogConfigs.java +++ b/server-common/src/main/java/org/apache/kafka/server/config/ServerLogConfigs.java @@ -135,15 +135,7 @@ public class ServerLogConfigs { public static final String MIN_IN_SYNC_REPLICAS_CONFIG = ServerTopicConfigSynonyms.serverSynonym(TopicConfig.MIN_IN_SYNC_REPLICAS_CONFIG); public static final int MIN_IN_SYNC_REPLICAS_DEFAULT = 1; - public static final String MIN_IN_SYNC_REPLICAS_DOC = "When a producer sets acks to \"all\" (or \"-1\"), " + - "min.insync.replicas specifies the minimum number of replicas that must acknowledge " + - "a write for the write to be considered successful. If this minimum cannot be met, " + - "then the producer will raise an exception (either NotEnoughReplicas or " + - "NotEnoughReplicasAfterAppend).
When used together, min.insync.replicas and acks " + - "allow you to enforce greater durability guarantees. A typical scenario would be to " + - "create a topic with a replication factor of 3, set min.insync.replicas to 2, and " + - "produce with acks of \"all\". This will ensure that the producer raises an exception " + - "if a majority of replicas do not receive a write."; + public static final String MIN_IN_SYNC_REPLICAS_DOC = TopicConfig.MIN_IN_SYNC_REPLICAS_DOC; public static final String CREATE_TOPIC_POLICY_CLASS_NAME_CONFIG = "create.topic.policy.class.name"; public static final String CREATE_TOPIC_POLICY_CLASS_NAME_DOC = "The create topic policy class that should be used for validation. The class should " +