FrankYang0529 commented on code in PR #17717:
URL: https://github.com/apache/kafka/pull/17717#discussion_r1833893802


##########
clients/src/main/java/org/apache/kafka/clients/producer/ProducerConfig.java:
##########
@@ -582,13 +582,8 @@ private void 
postProcessAndValidateIdempotenceConfigs(final Map<String, Object>
 
             final int inFlightConnection = 
this.getInt(MAX_IN_FLIGHT_REQUESTS_PER_CONNECTION);
             if (MAX_IN_FLIGHT_REQUESTS_PER_CONNECTION_FOR_IDEMPOTENCE < 
inFlightConnection) {
-                if (userConfiguredIdempotence) {
-                    throw new ConfigException("Must set " + 
MAX_IN_FLIGHT_REQUESTS_PER_CONNECTION + " to at most 5" +
-                        " to use the idempotent producer.");
-                }
-                log.warn("Idempotence will be disabled because {} is set to 
{}, which is greater than 5. " +
-                    "Please note that in v4.0.0 and onward, this will become 
an error.", MAX_IN_FLIGHT_REQUESTS_PER_CONNECTION, inFlightConnection);
-                shouldDisableIdempotence = true;
+                throw new ConfigException("To use the idempotent producer, " + 
MAX_IN_FLIGHT_REQUESTS_PER_CONNECTION +

Review Comment:
   IIUC, broker side only contains at most 5 batches. Event if the 
`enable.idempotence` is `false`, the maximum 
`MAX_IN_FLIGHT_REQUESTS_PER_CONNECTION` can't be more than `5`.
   
   
https://github.com/apache/kafka/blob/af53758746485daa06c4d4366036c04f7f9f0e63/storage/src/main/java/org/apache/kafka/storage/internals/log/ProducerStateEntry.java#L29-L36
   
   
https://github.com/apache/kafka/blob/af53758746485daa06c4d4366036c04f7f9f0e63/storage/src/main/java/org/apache/kafka/storage/internals/log/ProducerStateEntry.java#L107-L110



-- 
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]

Reply via email to