runzhiwang opened a new pull request #335: URL: https://github.com/apache/incubator-ratis/pull/335
## What changes were proposed in this pull request? 1. There are two usage for FileStore#read, the first is for FileStoreStateMachine#query which read data has been committed, the second if for FileStoreStateMachine#read which read data has been written by leader, and leader read the data to appendEntry to follower. So in the second case, we should not check `offset + length > committedSize`, we should check `offset + length > writeSize`  2. data length should use ByteBuffer#remaining() ``` final WriteRequestHeaderProto.Builder header = WriteRequestHeaderProto.newBuilder() .setPath(ProtoUtils.toByteString(path)) .setOffset(offset) - .setLength(data.position()) + .setLength(data.remaining()) .setClose(close); ``` ## What is the link to the Apache JIRA https://issues.apache.org/jira/browse/RATIS-1217 ## How was this patch tested? manually execute following command many times. ${BIN}/client.sh filestore loadgen --size 100000000 --numFiles 10 --bufferSize 4000000 --peers ${PEERS} ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected]
