You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ratis.apache.org by GitBox <gi...@apache.org> on 2021/01/29 19:58:36 UTC

[GitHub] [incubator-ratis] alpapad commented on a change in pull request #411: Fixes problems with large snapshots

alpapad commented on a change in pull request #411:
URL: https://github.com/apache/incubator-ratis/pull/411#discussion_r567062092



##########
File path: ratis-server/src/main/java/org/apache/ratis/server/storage/FileChunkReader.java
##########
@@ -65,7 +66,7 @@ public FileChunkReader(FileInfo info, RaftStorageDirectory directory) throws IOE
   public FileChunkProto readFileChunk(int chunkMaxSize) throws IOException {
     final long remaining = info.getFileSize() - offset;
     final int chunkLength = remaining < chunkMaxSize ? (int) remaining : chunkMaxSize;
-    final ByteString data = ByteString.readFrom(in, chunkLength);

Review comment:
       ByteString.readFrom(in, chunkLength) will read the whole file not just chunkLength




----------------------------------------------------------------
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:
users@infra.apache.org