SzyWilliam opened a new pull request, #661:
URL: https://github.com/apache/ratis/pull/661

   ## What changes were proposed in this pull request?
   Currently in InstallSnapshot, statemachine has to pre-compute each file's 
md5 digest and provide it in `FileInfo`. When snapshot file is large, this 
computing is time-consuming and may cause leader timeout. 
   In this PR I propose to move the computing task along within the 
InstallSnapshot stream process. That is, for each SnapshotChunk,  we can read 
the chunk & compute its moving MD5 digest in the same time. This can enable us 
to read file & compute file MD5 in one sequential scan and thus save IO costs.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/projects/RATIS/issues/RATIS-1597
   
   ## Compatible Change
   Current application code reply on Ratis won't be affected by this PR. If it 
gives digest in `FileInfo`, we still uses the given digest. However, when 
digest is not provided (null) in `FileInfo`, the digest will be calculated 
through above ways.
   
   ## How was this patch tested?
   
   It passes the UnitTest in InstallSnapshotFromLeaderTests.java
   


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to