[ https://issues.apache.org/jira/browse/KAFKA-376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13445013#comment-13445013 ]
Jun Rao commented on KAFKA-376: ------------------------------- Thanks for patch v4. The EasyMock issue is interesting. Maybe you have to mock getReplica(topic, partition) directly. Another thought. The only reason that we call getReplica in KafkaApis.readMessageSets(fetchRequest) is to get the highWatermark. We can change readMessageSet(topic: String, partition: Int, offset: Long, maxSize: Int, fromFollower: Boolean) to return Either[Short, (MessageSet, highWatermark]) instead. This way, we can avoid calling getReplica in the first readMessageSets(). In general, the fewer times that we call getReplica the better since there are few places for error handling. > expose different data to fetch requests from the follower replicas and > consumer clients > --------------------------------------------------------------------------------------- > > Key: KAFKA-376 > URL: https://issues.apache.org/jira/browse/KAFKA-376 > Project: Kafka > Issue Type: Bug > Components: core > Affects Versions: 0.8 > Reporter: Jun Rao > Assignee: Prashanth Menon > Labels: bugs > Attachments: KAFKA-376-DRAFT.patch, KAFKA-376-v1.patch, > KAFKA-376-v2.patch, KAFKA-376-v3.patch, KAFKA-376-v4.patch > > Original Estimate: 168h > Remaining Estimate: 168h > > Currently, the broker always uses highwatermark to calculate the available > bytes to a fetch request, no matter where the request is from. Instead, we > should use highwatermark for requests coming from real consumer clients and > use logendoffset for requests coming from follower replicas. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira