divijvaidya commented on code in PR #18874:
URL: https://github.com/apache/kafka/pull/18874#discussion_r1953143073
##########
server-common/src/main/java/org/apache/kafka/server/config/ServerLogConfigs.java:
##########
@@ -135,15 +135,19 @@ 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\"), " +
- "<code>min.insync.replicas</code> 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
<code>NotEnoughReplicas</code> or " +
- "<code>NotEnoughReplicasAfterAppend</code>).<br>When used
together, <code>min.insync.replicas</code> 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
<code>min.insync.replicas</code> 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 =
+ "Defines the minimum number of replica brokers that must acknowledge a
write operation " +
+ "when the producer uses acks='all'. This setting helps ensure data
durability by: \n" +
+ "\n" +
+ "1. Requiring at least this many replicas to be in-sync for writes to
succeed\n" +
+ "2. Failing write operations with NotEnoughReplicas if there aren't
enough in-sync replicas\n" +
+ "\n" +
+ "Example: With replication.factor=3 and min.insync.replicas=2:\n" +
+ "- Writes succeed if at least 2 replicas acknowledge\n" +
Review Comment:
I don't think this conveys the scenario in entirety. Write succeeds when all
replicas in ISR arrive even if min.ISR is set to 2. For example, let's say
number of replicas in ISR is 3. With ack='all' and min.isr = 2, a write will
wait on the leader until it gets acknowledgement from all 3 replicas (even if 2
have already acked back). Hence, the "at least" part is not entirely right.
I will suggest to remove this line from the example.
##########
server-common/src/main/java/org/apache/kafka/server/config/ServerLogConfigs.java:
##########
@@ -135,15 +135,19 @@ 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\"), " +
- "<code>min.insync.replicas</code> 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
<code>NotEnoughReplicas</code> or " +
- "<code>NotEnoughReplicasAfterAppend</code>).<br>When used
together, <code>min.insync.replicas</code> 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
<code>min.insync.replicas</code> 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 =
+ "Defines the minimum number of replica brokers that must acknowledge a
write operation " +
+ "when the producer uses acks='all'. This setting helps ensure data
durability by: \n" +
+ "\n" +
+ "1. Requiring at least this many replicas to be in-sync for writes to
succeed\n" +
+ "2. Failing write operations with NotEnoughReplicas if there aren't
enough in-sync replicas\n" +
Review Comment:
`NotEnoughReplicasAfterAppend` as well?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]