[ 
https://issues.apache.org/jira/browse/RATIS-944?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17132955#comment-17132955
 ] 

Lokesh Jain commented on RATIS-944:
-----------------------------------

[~dineshchitlangia] Its not a bug. 
read(LogEntryProto entry)
is used by server to read statemachine data for a corresponding WRITEHEADER 
request. 

> Fix FileStoreStateMachine#read
> ------------------------------
>
>                 Key: RATIS-944
>                 URL: https://issues.apache.org/jira/browse/RATIS-944
>             Project: Ratis
>          Issue Type: Bug
>    Affects Versions: 0.5.0
>            Reporter: Dinesh Chitlangia
>            Assignee: Dinesh Chitlangia
>            Priority: Major
>
> While reading the code, it appears that the FileStoreStateMachine#read 
> expects 
> FileStoreRequestProto.RequestCase.WRITEHEADER instead of the READHEADER
> It also attempts to process a Write Header and send as a Read Response.
> {code:java}
> public CompletableFuture<ByteString> read(LogEntryProto entry) {
> .
> .
> .
>  if (proto.getRequestCase() != FileStoreRequestProto.RequestCase.WRITEHEADER) 
> {
>  return null;
>  }
>  final WriteRequestHeaderProto h = proto.getWriteHeader();
>  CompletableFuture<ExamplesProtos.ReadReplyProto> reply =
>  files.read(h.getPath().toStringUtf8(), h.getOffset(), h.getLength());
>  return reply.thenApply(ExamplesProtos.ReadReplyProto::getData);
> }
> {code}
>  
>  May be I am just missing something here.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to