[ https://issues.apache.org/jira/browse/KAFKA-3197?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15130084#comment-15130084 ]
ASF GitHub Bot commented on KAFKA-3197: --------------------------------------- GitHub user becketqin opened a pull request: https://github.com/apache/kafka/pull/857 KAFKA-3197 Fix producer sending records out of order This patch adds a new configuration to the producer to enforce the maximum in flight batch for each partition. The patch itself is small, but this is an interface change. Given this is a pretty important fix, may be we can run a quick KIP on it. This patch did not remove max.in.flight.request.per.connection configuration because it might still have some value to throttle the number of requests sent to a broker. This is primarily for broker's interest. You can merge this pull request into a Git repository by running: $ git pull https://github.com/becketqin/kafka KAFKA-3197 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/kafka/pull/857.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #857 ---- commit c12c1e2044fe92954e0c8a27f63263f2020ddd3c Author: Jiangjie Qin <becket....@gmail.com> Date: 2016-02-03T06:51:41Z KAFKA-3197 Fix producer sending records out of order ---- > Producer can send message out of order even when in flight request is set to > 1. > ------------------------------------------------------------------------------- > > Key: KAFKA-3197 > URL: https://issues.apache.org/jira/browse/KAFKA-3197 > Project: Kafka > Issue Type: Bug > Components: clients, producer > Affects Versions: 0.9.0.0 > Reporter: Jiangjie Qin > Assignee: Jiangjie Qin > Fix For: 0.9.0.1 > > > The issue we saw is following: > 1. Producer send message 0 to topic-partition-0 on broker A. The in-flight > request to broker A is 1. > 2. The request is somehow lost > 3. Producer refreshed its topic metadata and found leader of > topic-partition-0 migrated from broker A to broker B. > 4. Because there is no in-flight request to broker B. All the subsequent > messages to topic-partition-0 in the record accumulator are sent to broker B. > 5. Later on when the request in step (1) times out, message 0 will be retried > and sent to broker B. At this point, all the later messages has already been > sent, so we have re-order. -- This message was sent by Atlassian JIRA (v6.3.4#6332)