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 2022/10/18 11:24:08 UTC

[GitHub] [ratis] szetszwo commented on a diff in pull request #765: RATIS-1723. CounterStateMachine should update the latest snapshot.

szetszwo commented on code in PR #765:
URL: https://github.com/apache/ratis/pull/765#discussion_r998076144


##########
ratis-server/src/main/java/org/apache/ratis/statemachine/impl/SimpleStateMachineStorage.java:
##########
@@ -60,13 +61,12 @@ public class SimpleStateMachineStorage implements StateMachineStorage {
       Pattern.compile(SNAPSHOT_FILE_PREFIX + "\\.(\\d+)_(\\d+)");
 
   private volatile File stateMachineDir = null;
-
-  private volatile SingleFileSnapshotInfo currentSnapshot = null;
+  private final AtomicReference<SnapshotInfo> latestSnapshot = new AtomicReference<>();

Review Comment:
   This is a good idea.  Thanks!



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