Uploaded image for project: 'Ratis'
  1. Ratis
  2. RATIS-944

Fix FileStoreStateMachine#read

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Invalid
    • 0.5.0
    • None
    • None
    • None

    Description

      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.

      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);
      }
      

       

       May be I am just missing something here.

      Attachments

        Activity

          People

            dineshchitlangia Dinesh Chitlangia
            dineshchitlangia Dinesh Chitlangia
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: