Skip to content

Commit

Permalink
Reset state with snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
yfei-z committed Aug 22, 2024
1 parent feb46dc commit 1a907f3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/org/jgroups/raft/blocks/CounterService.java
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ public void writeContentTo(DataOutput out) throws Exception {
@Override
public void readContentFrom(DataInput in) throws Exception {
synchronized (counters) {
counters.clear();
int size = in.readInt();
for (int i = 0; i < size; i++) {
AsciiString name = Bits.readAsciiString(in);
Expand Down
1 change: 1 addition & 0 deletions src/org/jgroups/raft/blocks/ReplicatedStateMachine.java
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ public int size() {
tmp.put(key, val);
}
synchronized(map) {
map.clear();
map.putAll(tmp);
}
}
Expand Down

0 comments on commit 1a907f3

Please sign in to comment.