Skip to content

Commit

Permalink
Warn about usage of snapshots (hashicorp#618)
Browse files Browse the repository at this point in the history
* Update fsm.go

* Update fsm.go
  • Loading branch information
otoolep authored Sep 24, 2024
1 parent 42d3446 commit dd1f3da
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions fsm.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ type FSM interface {
// Apply and Snapshot are always called from the same thread, but Apply will
// be called concurrently with FSMSnapshot.Persist. This means the FSM should
// be implemented to allow for concurrent updates while a snapshot is happening.
//
// Clients of this library should make no assumptions about whether a returned
// Snapshot() will actually be stored by Raft. In fact it's quite possible that
// any Snapshot returned by this call will be discarded, and that
// FSMSnapshot.Persist will never be called. Raft will always call
// FSMSnapshot.Release however.
Snapshot() (FSMSnapshot, error)

// Restore is used to restore an FSM from a snapshot. It is not called
Expand Down

0 comments on commit dd1f3da

Please sign in to comment.