[ 
https://issues.apache.org/jira/browse/KAFKA-376?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Prashanth Menon updated KAFKA-376:
----------------------------------

    Attachment: KAFKA-376-DRAFT.patch

Hi all, I feel like I should add a draft patch because the code has grown much 
more complex since the last time I touched it.  The patch itself is minimal but 
a little nasty, so I'd like to clean it up a little but I figured I'd submit a 
draft so more eyes can get on it.  Here goes ... an outline:

1. Modified KafkaApis.availableFetchBytes to check the leader replicas 
highwaterMark if the request is coming from a follower, otherwise use the 
logEndOffset.  
2. Modified readMessageSet to not read beyond the highwaterMark of the 
replica's log (which is local because it's the leader) if the request is coming 
from a regular, non-follower, consumer.

One thing I'm considering doing is putting the log read logic in the replica 
itself since it is aware of hw and leo.  There's also a 
ReplicaManager.getLeaderReplica that throws an exception if the leader replica 
doesn't exist but returns an Option[Replica] - can this just return a Replica?  

As for the test, I couldn't find a decent place to put it because it includes 
both replication and simple consumer tests.  Rather than split the tests into 
two separate classes, I thought it'd be better to group them together.

Looking forward to the suggestions.
                
> 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
>         Attachments: KAFKA-376-DRAFT.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: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to