[ https://issues.apache.org/jira/browse/KAFKA-5745?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16129839#comment-16129839 ]
ASF GitHub Bot commented on KAFKA-5745: --------------------------------------- GitHub user huxihx opened a pull request: https://github.com/apache/kafka/pull/3682 KAFKA-5745: makeLeader should invoke `convertHWToLocalOffsetMetadata` before marking it as leader You can merge this pull request into a Git repository by running: $ git pull https://github.com/huxihx/kafka KAFKA-5745 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/kafka/pull/3682.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 #3682 ---- commit 3d7c4081428a7eae0ba1cb26e017b9bcbc1603c7 Author: huxihx <huxi...@hotmail.com> Date: 2017-08-17T03:47:25Z KAFKA-5745: makeLeader should invoke `convertHWToLocalOffsetMetadata` before marking local replica as the leader. ---- > Partition.makeLeader() should convert HW to OffsetMetadata before becoming > the leader > ------------------------------------------------------------------------------------- > > Key: KAFKA-5745 > URL: https://issues.apache.org/jira/browse/KAFKA-5745 > Project: Kafka > Issue Type: Bug > Components: core > Affects Versions: 0.11.0.0 > Reporter: Jun Rao > > Saw the following uncaught exception in the log. > ERROR [KafkaApi-411] Error when handling request Name: FetchRequest; Version: > 3; CorrelationId: 708572; ClientId: client-0; ReplicaId: -1; MaxWait: 500 ms; > MinBytes: 1 bytes; MaxBytes:52428800 bytes; RequestInfo: > ([topic1,3],PartitionFetchInfo(953794,1048576)) (kafka.server.KafkaApis) > org.apache.kafka.common.KafkaException: 953793 [-1 : -1] cannot compare its > segment info with 953794 [829749 : 564535961] since it only has message > offset info > at kafka.server.LogOffsetMetadata.onOlderSegment(LogOffsetMetadata.scala:48) > at > kafka.server.DelayedFetch$$anonfun$tryComplete$1.apply(DelayedFetch.scala:93) > at > kafka.server.DelayedFetch$$anonfun$tryComplete$1.apply(DelayedFetch.scala:77) > at > scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59) > > at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:48) > at kafka.server.DelayedFetch.tryComplete(DelayedFetch.scala:77) > at kafka.server.DelayedOperation.safeTryComplete(DelayedOperation.scala:104) > at > kafka.server.DelayedOperationPurgatory.tryCompleteElseWatch(DelayedOperation.scala:196) > > at kafka.server.ReplicaManager.fetchMessages(ReplicaManager.scala:516) > at kafka.server.KafkaApis.handleFetchRequest(KafkaApis.scala:534) > at kafka.server.KafkaApis.handle(KafkaApis.scala:79) > at kafka.server.KafkaRequestHandler.run(KafkaRequestHandler.scala:60) > at java.lang.Thread.run(Thread.java:745) -- This message was sent by Atlassian JIRA (v6.4.14#64029)