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 2023/01/04 06:42:49 UTC

[GitHub] [ratis] SzyWilliam commented on pull request #802: RATIS-1764. [GrpcLogAppender] Automatic recover from install snapshot failure

SzyWilliam commented on PR #802:
URL: https://github.com/apache/ratis/pull/802#issuecomment-1370540424

   @szetszwo Thanks for reviewing this! 
   
   After digging deep into the error today, I found the problem is not caused by what I stated previous as 
   
   > The retry attempt will fail because the createDirectories [here](https://github.com/apache/ratis/blob/1b3c61d5dbcdb2b1ac5fd49a624a6cb88ab04744/ratis-server/src/main/java/org/apache/ratis/server/storage/SnapshotManager.java#L105) will throw a file already exist exception. This PR add a if-clause to create directory only when the directory does not exists.
   
   The actual cause is, one large snapshot file may require **multiple installSnapshot RPCs** to transfer. The first RPC will create `tmpSnapshotFile`, and the subsequent RPCs will append chunk data to this existed `tmpSnapshotFile`.  These subsequent RPCs will fail when calling `createDirectories` as the `tmpSnapshotFile` already exists.
   
   Therefore, I think we shall call `createDirectories` once when `tmpSnapshotFile` does not exist. What do you think?


-- 
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: issues-unsubscribe@ratis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org