mirror of
https://github.com/status-im/consul.git
synced 2025-02-16 23:57:07 +00:00
Tweaks a few comments.
This commit is contained in:
parent
75f2aa8588
commit
b787aa17ab
@ -28,8 +28,8 @@ type consulFSM struct {
|
|||||||
|
|
||||||
// stateLock is only used to protect outside callers to State() from
|
// stateLock is only used to protect outside callers to State() from
|
||||||
// racing with Restore(), which is called by Raft (it puts in a totally
|
// racing with Restore(), which is called by Raft (it puts in a totally
|
||||||
// new state store). Everything else is synchronized by the Raft side,
|
// new state store). Everything internal here is synchronized by the
|
||||||
// so doesn't need to lock this.
|
// Raft side, so doesn't need to lock this.
|
||||||
stateLock sync.RWMutex
|
stateLock sync.RWMutex
|
||||||
state *state.StateStore
|
state *state.StateStore
|
||||||
|
|
||||||
@ -336,7 +336,7 @@ func (c *consulFSM) Restore(old io.ReadCloser) error {
|
|||||||
|
|
||||||
// The old state store has been abandoned already since we've replaced
|
// The old state store has been abandoned already since we've replaced
|
||||||
// it with an empty one, but we defer telling watchers about it until
|
// it with an empty one, but we defer telling watchers about it until
|
||||||
// the restore is done, so they wake up one we have the latest data.
|
// the restore is done, so they wake up once we have the latest data.
|
||||||
defer stateOld.Abandon()
|
defer stateOld.Abandon()
|
||||||
|
|
||||||
// Set up a new restore transaction
|
// Set up a new restore transaction
|
||||||
|
@ -354,7 +354,10 @@ func (s *Server) raftApply(t structs.MessageType, msg interface{}) (interface{},
|
|||||||
}
|
}
|
||||||
|
|
||||||
// queryFn is used to perform a query operation. If a re-query is needed, the
|
// queryFn is used to perform a query operation. If a re-query is needed, the
|
||||||
// passed-in watch set will be used to block for changes.
|
// passed-in watch set will be used to block for changes. The passed-in state
|
||||||
|
// store should be used (vs. calling fsm.State()) since the given state store
|
||||||
|
// will be correctly watched for changes if the state store is restored from
|
||||||
|
// a snapshot.
|
||||||
type queryFn func(memdb.WatchSet, *state.StateStore) error
|
type queryFn func(memdb.WatchSet, *state.StateStore) error
|
||||||
|
|
||||||
// blockingQuery is used to process a potentially blocking query operation.
|
// blockingQuery is used to process a potentially blocking query operation.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user