You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2021/05/14 01:17:48 UTC

[GitHub] [kafka] ableegoldman opened a new pull request #10690: MINOR: clarify message ordering with max in-flight requests and idempotent producer

ableegoldman opened a new pull request #10690:
URL: https://github.com/apache/kafka/pull/10690


   The docs for the `max.in.flight.requests.per.connection` and `enable.idempotence` configs currently imply that setting the max in-flight request greater than 1 will break the message ordering guarantee, but that is only true if `enable.idempotence` is false. When using an idempotent producer, the max in-flight request can be up to 5 without re-ordering messages.
   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] ableegoldman commented on a change in pull request #10690: MINOR: clarify message ordering with max in-flight requests and idempotent producer

Posted by GitBox <gi...@apache.org>.
ableegoldman commented on a change in pull request #10690:
URL: https://github.com/apache/kafka/pull/10690#discussion_r632355592



##########
File path: clients/src/main/java/org/apache/kafka/clients/producer/ProducerConfig.java
##########
@@ -247,9 +248,10 @@
     public static final String ENABLE_IDEMPOTENCE_DOC = "When set to 'true', the producer will ensure that exactly one copy of each message is written in the stream. If 'false', producer "
                                                         + "retries due to broker failures, etc., may write duplicates of the retried message in the stream. "
                                                         + "Note that enabling idempotence requires <code>" + MAX_IN_FLIGHT_REQUESTS_PER_CONNECTION + "</code> to be less than or equal to 5, "
-                                                        + "<code>" + RETRIES_CONFIG + "</code> to be greater than 0 and <code>" + ACKS_CONFIG + "</code> must be 'all'. If these values "
+                                                        + "<code>" + RETRIES_CONFIG + "</code> to be greater than 0, and <code>" + ACKS_CONFIG + "</code> must be 'all'. If these values "
                                                         + "are not explicitly set by the user, suitable values will be chosen. If incompatible values are set, "
-                                                        + "a <code>ConfigException</code> will be thrown.";
+                                                        + "a <code>ConfigException</code> will be thrown. With an idempotent producer, setting the <code>" + MAX_IN_FLIGHT_REQUESTS_PER_CONNECTION
+                                                        + "</code> greater than 1 will not break ordering guarantees.";

Review comment:
       That requirement is covered a few sentences before this one, it might be cut off by Github.  I think it's clear that by "greater than 1", we just mean "between 1 and 5, the maximum allowable limit as stated above"




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] mjsax commented on pull request #10690: MINOR: clarify message ordering with max in-flight requests and idempotent producer

Posted by GitBox <gi...@apache.org>.
mjsax commented on pull request #10690:
URL: https://github.com/apache/kafka/pull/10690#issuecomment-846464379


   From my side: ship it.


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] ableegoldman commented on a change in pull request #10690: MINOR: clarify message ordering with max in-flight requests and idempotent producer

Posted by GitBox <gi...@apache.org>.
ableegoldman commented on a change in pull request #10690:
URL: https://github.com/apache/kafka/pull/10690#discussion_r632788590



##########
File path: clients/src/main/java/org/apache/kafka/clients/producer/ProducerConfig.java
##########
@@ -247,9 +248,10 @@
     public static final String ENABLE_IDEMPOTENCE_DOC = "When set to 'true', the producer will ensure that exactly one copy of each message is written in the stream. If 'false', producer "
                                                         + "retries due to broker failures, etc., may write duplicates of the retried message in the stream. "
                                                         + "Note that enabling idempotence requires <code>" + MAX_IN_FLIGHT_REQUESTS_PER_CONNECTION + "</code> to be less than or equal to 5, "
-                                                        + "<code>" + RETRIES_CONFIG + "</code> to be greater than 0 and <code>" + ACKS_CONFIG + "</code> must be 'all'. If these values "
+                                                        + "<code>" + RETRIES_CONFIG + "</code> to be greater than 0, and <code>" + ACKS_CONFIG + "</code> must be 'all'. If these values "
                                                         + "are not explicitly set by the user, suitable values will be chosen. If incompatible values are set, "
-                                                        + "a <code>ConfigException</code> will be thrown.";
+                                                        + "a <code>ConfigException</code> will be thrown. With an idempotent producer, setting the <code>" + MAX_IN_FLIGHT_REQUESTS_PER_CONNECTION
+                                                        + "</code> greater than 1 will not break ordering guarantees.";

Review comment:
       will do




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] ijuma commented on a change in pull request #10690: MINOR: clarify message ordering with max in-flight requests and idempotent producer

Posted by GitBox <gi...@apache.org>.
ijuma commented on a change in pull request #10690:
URL: https://github.com/apache/kafka/pull/10690#discussion_r632510173



##########
File path: clients/src/main/java/org/apache/kafka/clients/producer/ProducerConfig.java
##########
@@ -247,9 +248,10 @@
     public static final String ENABLE_IDEMPOTENCE_DOC = "When set to 'true', the producer will ensure that exactly one copy of each message is written in the stream. If 'false', producer "
                                                         + "retries due to broker failures, etc., may write duplicates of the retried message in the stream. "
                                                         + "Note that enabling idempotence requires <code>" + MAX_IN_FLIGHT_REQUESTS_PER_CONNECTION + "</code> to be less than or equal to 5, "
-                                                        + "<code>" + RETRIES_CONFIG + "</code> to be greater than 0 and <code>" + ACKS_CONFIG + "</code> must be 'all'. If these values "
+                                                        + "<code>" + RETRIES_CONFIG + "</code> to be greater than 0, and <code>" + ACKS_CONFIG + "</code> must be 'all'. If these values "
                                                         + "are not explicitly set by the user, suitable values will be chosen. If incompatible values are set, "
-                                                        + "a <code>ConfigException</code> will be thrown.";
+                                                        + "a <code>ConfigException</code> will be thrown. With an idempotent producer, setting the <code>" + MAX_IN_FLIGHT_REQUESTS_PER_CONNECTION
+                                                        + "</code> greater than 1 will not break ordering guarantees.";

Review comment:
       Instead of an additional sentence at the end, could we modify the original sentence to also mention ordering?

##########
File path: clients/src/main/java/org/apache/kafka/clients/producer/ProducerConfig.java
##########
@@ -247,9 +248,10 @@
     public static final String ENABLE_IDEMPOTENCE_DOC = "When set to 'true', the producer will ensure that exactly one copy of each message is written in the stream. If 'false', producer "
                                                         + "retries due to broker failures, etc., may write duplicates of the retried message in the stream. "
                                                         + "Note that enabling idempotence requires <code>" + MAX_IN_FLIGHT_REQUESTS_PER_CONNECTION + "</code> to be less than or equal to 5, "
-                                                        + "<code>" + RETRIES_CONFIG + "</code> to be greater than 0 and <code>" + ACKS_CONFIG + "</code> must be 'all'. If these values "
+                                                        + "<code>" + RETRIES_CONFIG + "</code> to be greater than 0, and <code>" + ACKS_CONFIG + "</code> must be 'all'. If these values "
                                                         + "are not explicitly set by the user, suitable values will be chosen. If incompatible values are set, "
-                                                        + "a <code>ConfigException</code> will be thrown.";
+                                                        + "a <code>ConfigException</code> will be thrown. With an idempotent producer, setting the <code>" + MAX_IN_FLIGHT_REQUESTS_PER_CONNECTION
+                                                        + "</code> greater than 1 will not break ordering guarantees.";

Review comment:
       Instead of an additional sentence at the end, could we modify the first sentence to also mention ordering?




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] ableegoldman commented on pull request #10690: MINOR: clarify message ordering with max in-flight requests and idempotent producer

Posted by GitBox <gi...@apache.org>.
ableegoldman commented on pull request #10690:
URL: https://github.com/apache/kafka/pull/10690#issuecomment-841084469


   Wow, all checks actually passed! That's the second completely green build I've seen in 24 hours, must be my lucky day 😄 


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] ableegoldman commented on pull request #10690: MINOR: clarify message ordering with max in-flight requests and idempotent producer

Posted by GitBox <gi...@apache.org>.
ableegoldman commented on pull request #10690:
URL: https://github.com/apache/kafka/pull/10690#issuecomment-842508231


   Just the one flaky test `org.apache.kafka.streams.integration.KTableKTableForeignKeyInnerJoinMultiIntegrationTest.shouldInnerJoinMultiPartitionQueryable()` which Luke is going to look into. This should be ready to merge if there are no further suggestions @ijuma  @mjsax 


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] ableegoldman commented on pull request #10690: MINOR: clarify message ordering with max in-flight requests and idempotent producer

Posted by GitBox <gi...@apache.org>.
ableegoldman commented on pull request #10690:
URL: https://github.com/apache/kafka/pull/10690#issuecomment-842508231


   Just the one flaky test `org.apache.kafka.streams.integration.KTableKTableForeignKeyInnerJoinMultiIntegrationTest.shouldInnerJoinMultiPartitionQueryable()` which Luke is going to look into. This should be ready to merge if there are no further suggestions @ijuma  @mjsax 


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] ableegoldman commented on a change in pull request #10690: MINOR: clarify message ordering with max in-flight requests and idempotent producer

Posted by GitBox <gi...@apache.org>.
ableegoldman commented on a change in pull request #10690:
URL: https://github.com/apache/kafka/pull/10690#discussion_r636617410



##########
File path: clients/src/main/java/org/apache/kafka/clients/producer/ProducerConfig.java
##########
@@ -246,8 +246,8 @@
     public static final String ENABLE_IDEMPOTENCE_CONFIG = "enable.idempotence";
     public static final String ENABLE_IDEMPOTENCE_DOC = "When set to 'true', the producer will ensure that exactly one copy of each message is written in the stream. If 'false', producer "
                                                         + "retries due to broker failures, etc., may write duplicates of the retried message in the stream. "
-                                                        + "Note that enabling idempotence requires <code>" + MAX_IN_FLIGHT_REQUESTS_PER_CONNECTION + "</code> to be less than or equal to 5, "
-                                                        + "<code>" + RETRIES_CONFIG + "</code> to be greater than 0 and <code>" + ACKS_CONFIG + "</code> must be 'all'. If these values "
+                                                        + "Note that enabling idempotence requires <code>" + MAX_IN_FLIGHT_REQUESTS_PER_CONNECTION + "</code> to be less than or equal to 5 (with message ordering preserved for any allowable vlaue), "

Review comment:
       thank! fixed




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] mjsax commented on a change in pull request #10690: MINOR: clarify message ordering with max in-flight requests and idempotent producer

Posted by GitBox <gi...@apache.org>.
mjsax commented on a change in pull request #10690:
URL: https://github.com/apache/kafka/pull/10690#discussion_r632283761



##########
File path: clients/src/main/java/org/apache/kafka/clients/producer/ProducerConfig.java
##########
@@ -247,9 +248,10 @@
     public static final String ENABLE_IDEMPOTENCE_DOC = "When set to 'true', the producer will ensure that exactly one copy of each message is written in the stream. If 'false', producer "
                                                         + "retries due to broker failures, etc., may write duplicates of the retried message in the stream. "
                                                         + "Note that enabling idempotence requires <code>" + MAX_IN_FLIGHT_REQUESTS_PER_CONNECTION + "</code> to be less than or equal to 5, "
-                                                        + "<code>" + RETRIES_CONFIG + "</code> to be greater than 0 and <code>" + ACKS_CONFIG + "</code> must be 'all'. If these values "
+                                                        + "<code>" + RETRIES_CONFIG + "</code> to be greater than 0, and <code>" + ACKS_CONFIG + "</code> must be 'all'. If these values "
                                                         + "are not explicitly set by the user, suitable values will be chosen. If incompatible values are set, "
-                                                        + "a <code>ConfigException</code> will be thrown.";
+                                                        + "a <code>ConfigException</code> will be thrown. With an idempotent producer, setting the <code>" + MAX_IN_FLIGHT_REQUESTS_PER_CONNECTION
+                                                        + "</code> greater than 1 will not break ordering guarantees.";

Review comment:
       nit: max-in-flight cannot be larger than 5 if idempotent producer is enabled. 




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] ableegoldman commented on a change in pull request #10690: MINOR: clarify message ordering with max in-flight requests and idempotent producer

Posted by GitBox <gi...@apache.org>.
ableegoldman commented on a change in pull request #10690:
URL: https://github.com/apache/kafka/pull/10690#discussion_r632787843



##########
File path: clients/src/main/java/org/apache/kafka/clients/producer/ProducerConfig.java
##########
@@ -201,7 +201,8 @@
     public static final String MAX_IN_FLIGHT_REQUESTS_PER_CONNECTION = "max.in.flight.requests.per.connection";
     private static final String MAX_IN_FLIGHT_REQUESTS_PER_CONNECTION_DOC = "The maximum number of unacknowledged requests the client will send on a single connection before blocking."
                                                                             + " Note that if this setting is set to be greater than 1 and there are failed sends, there is a risk of"
-                                                                            + " message re-ordering due to retries (i.e., if retries are enabled).";
+                                                                            + " message re-ordering due to retries (i.e., if retries are enabled). With an idempotent producer, this"
+                                                                            + " can be up to 5 and still provide ordering guarantees.";

Review comment:
       @ijuma done




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] showuon commented on a change in pull request #10690: MINOR: clarify message ordering with max in-flight requests and idempotent producer

Posted by GitBox <gi...@apache.org>.
showuon commented on a change in pull request #10690:
URL: https://github.com/apache/kafka/pull/10690#discussion_r636611321



##########
File path: clients/src/main/java/org/apache/kafka/clients/producer/ProducerConfig.java
##########
@@ -246,8 +246,8 @@
     public static final String ENABLE_IDEMPOTENCE_CONFIG = "enable.idempotence";
     public static final String ENABLE_IDEMPOTENCE_DOC = "When set to 'true', the producer will ensure that exactly one copy of each message is written in the stream. If 'false', producer "
                                                         + "retries due to broker failures, etc., may write duplicates of the retried message in the stream. "
-                                                        + "Note that enabling idempotence requires <code>" + MAX_IN_FLIGHT_REQUESTS_PER_CONNECTION + "</code> to be less than or equal to 5, "
-                                                        + "<code>" + RETRIES_CONFIG + "</code> to be greater than 0 and <code>" + ACKS_CONFIG + "</code> must be 'all'. If these values "
+                                                        + "Note that enabling idempotence requires <code>" + MAX_IN_FLIGHT_REQUESTS_PER_CONNECTION + "</code> to be less than or equal to 5 (with message ordering preserved for any allowable vlaue), "

Review comment:
       typo: with message ordering preserved for any allowable **vlaue** --> **value**




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] ijuma commented on a change in pull request #10690: MINOR: clarify message ordering with max in-flight requests and idempotent producer

Posted by GitBox <gi...@apache.org>.
ijuma commented on a change in pull request #10690:
URL: https://github.com/apache/kafka/pull/10690#discussion_r632509174



##########
File path: clients/src/main/java/org/apache/kafka/clients/producer/ProducerConfig.java
##########
@@ -201,7 +201,8 @@
     public static final String MAX_IN_FLIGHT_REQUESTS_PER_CONNECTION = "max.in.flight.requests.per.connection";
     private static final String MAX_IN_FLIGHT_REQUESTS_PER_CONNECTION_DOC = "The maximum number of unacknowledged requests the client will send on a single connection before blocking."
                                                                             + " Note that if this setting is set to be greater than 1 and there are failed sends, there is a risk of"
-                                                                            + " message re-ordering due to retries (i.e., if retries are enabled).";
+                                                                            + " message re-ordering due to retries (i.e., if retries are enabled). With an idempotent producer, this"
+                                                                            + " can be up to 5 and still provide ordering guarantees.";

Review comment:
       The `enable.idempotence` will be true by default in 3.0, so we should perhaps have the "up to 5" thing first.




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] ableegoldman commented on pull request #10690: MINOR: clarify message ordering with max in-flight requests and idempotent producer

Posted by GitBox <gi...@apache.org>.
ableegoldman commented on pull request #10690:
URL: https://github.com/apache/kafka/pull/10690#issuecomment-847413919


   Some unrelated test failures in `RaftClusterTest`, `connect.integration.RebalanceSourceConnectorsIntegrationTest.testDeleteConnector()`, and 
   `kafka.api.PlaintextConsumerTest.testPartitionsFor()`
   
   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] ableegoldman merged pull request #10690: MINOR: clarify message ordering with max in-flight requests and idempotent producer

Posted by GitBox <gi...@apache.org>.
ableegoldman merged pull request #10690:
URL: https://github.com/apache/kafka/pull/10690


   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] ableegoldman edited a comment on pull request #10690: MINOR: clarify message ordering with max in-flight requests and idempotent producer

Posted by GitBox <gi...@apache.org>.
ableegoldman edited a comment on pull request #10690:
URL: https://github.com/apache/kafka/pull/10690#issuecomment-847413919


   Some unrelated test failures in `RaftClusterTest`, `connect.integration.RebalanceSourceConnectorsIntegrationTest.testDeleteConnector()`, and 
   `kafka.api.PlaintextConsumerTest.testPartitionsFor()`
   
   Will merge to trunk


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org