You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ratis.apache.org by "Tsz-wo Sze (Jira)" <ji...@apache.org> on 2022/08/23 23:44:00 UTC

[jira] [Assigned] (RATIS-1681) InstallSnapshot Atomicity

     [ https://issues.apache.org/jira/browse/RATIS-1681?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tsz-wo Sze reassigned RATIS-1681:
---------------------------------

    Component/s: util
       Assignee: Song Ziyang

> InstallSnapshot Atomicity
> -------------------------
>
>                 Key: RATIS-1681
>                 URL: https://issues.apache.org/jira/browse/RATIS-1681
>             Project: Ratis
>          Issue Type: Improvement
>          Components: util
>    Affects Versions: 2.3.0
>            Reporter: Song Ziyang
>            Assignee: Song Ziyang
>            Priority: Major
>             Fix For: 2.4.0
>
>          Time Spent: 50m
>  Remaining Estimate: 0h
>
> After installing a snapshot from leader, SnapshotManager will rename the tmp dir to statemachine dir so that the latest snapshot is visible to statemachine, see https://github.com/apache/ratis/blob/e49687aba20cad70c576900f1be59bb8fcd55d10/ratis-server/src/main/java/org/apache/ratis/server/storage/SnapshotManager.java#L154.
> SnapshotManager uses Files.move underlying to rename the tmpdir to statemachine, see https://github.com/apache/ratis/blob/e49687aba20cad70c576900f1be59bb8fcd55d10/ratis-common/src/main/java/org/apache/ratis/util/FileUtils.java#L80. Files.move provide a CopyOption as StandardCopyOption.ATOMIC_MOVE, which guarantees atomicity in move operation, see https://docs.oracle.com/javase/8/docs/api/java/nio/file/StandardCopyOption.html.
> We should use this option explicitly.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)