1
0
Fork 0

Merge pull request #1389 from rqlite/otoolep-patch-simpler-logging

Simpler logging of first application
master
Philip O'Toole 1 year ago committed by GitHub
commit 6cb5f14c5d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -205,7 +205,6 @@ type Store struct {
observerChan chan raft.Observation
observer *raft.Observer
firstLogApplied bool // Whether the first log has been applied to the FSM.
firstIdxOnOpen uint64 // First index on log when Store opens.
lastIdxOnOpen uint64 // Last index on log when Store opens.
lastCommandIdxOnOpen uint64 // Last command index before applied index when Store opens.
@ -1575,10 +1574,6 @@ func (s *Store) Apply(l *raft.Log) (e interface{}) {
defer s.fsmIndexMu.Unlock()
s.fsmIndex = l.Index
if !s.firstLogApplied {
s.firstLogApplied = true
s.logger.Printf("first log applied since node start, log at index %d", l.Index)
}
if l.Index <= s.lastCommandIdxOnOpen {
// In here means at least one command entry was in the log when the Store
// opened.
@ -1592,6 +1587,7 @@ func (s *Store) Apply(l *raft.Log) (e interface{}) {
if s.firstLogAppliedT.IsZero() {
s.firstLogAppliedT = time.Now()
s.logger.Printf("first log applied since node start, log at index %d", l.Index)
}
typ, r := applyCommand(l.Data, &s.db, s.dechunkManager)

Loading…
Cancel
Save