Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
leixm committed Jun 12, 2024
1 parent a1567ea commit 7b052d4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@
import java.nio.file.DirectoryStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.*;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.Iterator;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.concurrent.atomic.AtomicReference;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
Expand Down Expand Up @@ -206,7 +211,7 @@ public File getTmpDir() {
return tmpDir;
}

public void refreshLatestSnapshot() {
public void loadLatestSnapshot() {
final File dir = stateMachineDir;
if (dir == null) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public void initialize(RaftServer server, RaftGroupId id, RaftStorage raftStorag
public void reinitialize() throws IOException {
LOG.info("Reinitializing state machine.");
getLifeCycle().compareAndTransition(PAUSED, STARTING);
storage.refreshLatestSnapshot();
storage.loadLatestSnapshot();
loadSnapshot(storage.getLatestSnapshot());
getLifeCycle().compareAndTransition(STARTING, RUNNING);
}
Expand Down

0 comments on commit 7b052d4

Please sign in to comment.