kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gwens...@apache.org
Subject kafka git commit: KAFKA-3427: broker can return incorrect version of fetch response when the broker hits an unknown exception
Date Sun, 20 Mar 2016 01:05:00 GMT
Repository: kafka
Updated Branches:
  refs/heads/trunk b6c6291e1 -> 655367971


KAFKA-3427: broker can return incorrect version of fetch response when the broker hits an
unknown exception

Author: Jun Rao <junrao@gmail.com>

Reviewers: Ismael Juma, Becket Qin

Closes #1101 from junrao/kafka-3427


Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/65536797
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/65536797
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/65536797

Branch: refs/heads/trunk
Commit: 655367971875a8d6a079ff7d186c05a6b76a9c53
Parents: b6c6291
Author: Jun Rao <junrao@gmail.com>
Authored: Sat Mar 19 18:04:56 2016 -0700
Committer: Gwen Shapira <cshapi@gmail.com>
Committed: Sat Mar 19 18:04:56 2016 -0700

----------------------------------------------------------------------
 core/src/main/scala/kafka/api/FetchRequest.scala | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/65536797/core/src/main/scala/kafka/api/FetchRequest.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/kafka/api/FetchRequest.scala b/core/src/main/scala/kafka/api/FetchRequest.scala
index f47942c..83e139a 100644
--- a/core/src/main/scala/kafka/api/FetchRequest.scala
+++ b/core/src/main/scala/kafka/api/FetchRequest.scala
@@ -150,7 +150,8 @@ case class FetchRequest(versionId: Short = FetchRequest.CurrentVersion,
       case (topicAndPartition, data) =>
         (topicAndPartition, FetchResponsePartitionData(Errors.forException(e).code, -1, MessageSet.Empty))
     }
-    val errorResponse = FetchResponse(correlationId, fetchResponsePartitionData)
+    val fetchRequest = request.requestObj.asInstanceOf[FetchRequest]
+    val errorResponse = FetchResponse(correlationId, fetchResponsePartitionData, fetchRequest.versionId)
     // Magic value does not matter here because the message set is empty
     requestChannel.sendResponse(new RequestChannel.Response(request, new FetchResponseSend(request.connectionId,
errorResponse)))
   }


Mime
View raw message