Skip to content

Commit

Permalink
fix(raft) removed dead code and fixed linter issues
Browse files Browse the repository at this point in the history
  • Loading branch information
denis-gudim committed Dec 26, 2022
1 parent 60686b9 commit 9bf2be1
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 9 deletions.
2 changes: 0 additions & 2 deletions raft/etcd/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ package etcd

import (
"fmt"
"io/ioutil"
"log"
"os"
)
Expand Down Expand Up @@ -45,7 +44,6 @@ func SetLogger(l Logger) { raftLogger = l }

var (
defaultLogger = &DefaultLogger{Logger: log.New(os.Stderr, "raft", log.Ldate|log.Lmicroseconds)}
discardLogger = &DefaultLogger{Logger: log.New(ioutil.Discard, "", 0)}
raftLogger = Logger(defaultLogger)
)

Expand Down
7 changes: 0 additions & 7 deletions raft/etcd/raft.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ const (
StateCandidate
StateLeader
StatePreCandidate
numStates
)

type ReadOnlyOption int
Expand Down Expand Up @@ -1250,12 +1249,6 @@ func (r *raft) handleSnapshot(m pb.Message) {
}
}

func (r *raft) initialized() bool {
// empty 'prs' and 'learnerPrs' means that
// this peer is newly created by conf change
return len(r.prs) > 0 || len(r.learnerPrs) > 0
}

// restore recovers the state machine from a snapshot. It restores the log and the
// configuration of state machine.
func (r *raft) restore(s pb.Snapshot) bool {
Expand Down

0 comments on commit 9bf2be1

Please sign in to comment.