mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
bump(github.com/coreos/raft): ca61124b291fe38a2ab592a8b42f1423e3c31cc4
This commit is contained in:
parent
2504c4ad34
commit
44af8ea190
@ -2,8 +2,7 @@ package raft
|
||||
|
||||
// Join command interface
|
||||
type JoinCommand interface {
|
||||
CommandName() string
|
||||
Apply(server Server) (interface{}, error)
|
||||
Command
|
||||
NodeName() string
|
||||
}
|
||||
|
||||
|
@ -2,8 +2,7 @@ package raft
|
||||
|
||||
// Leave command interface
|
||||
type LeaveCommand interface {
|
||||
CommandName() string
|
||||
Apply(server Server) (interface{}, error)
|
||||
Command
|
||||
NodeName() string
|
||||
}
|
||||
|
||||
|
6
third_party/github.com/coreos/raft/log.go
vendored
6
third_party/github.com/coreos/raft/log.go
vendored
@ -74,11 +74,7 @@ func (l *Log) CommitIndex() uint64 {
|
||||
func (l *Log) currentIndex() uint64 {
|
||||
l.mutex.RLock()
|
||||
defer l.mutex.RUnlock()
|
||||
|
||||
if len(l.entries) == 0 {
|
||||
return l.startIndex
|
||||
}
|
||||
return l.entries[len(l.entries)-1].Index
|
||||
return l.internalCurrentIndex()
|
||||
}
|
||||
|
||||
// The current index in the log without locking
|
||||
|
2
third_party/github.com/coreos/raft/server.go
vendored
2
third_party/github.com/coreos/raft/server.go
vendored
@ -176,7 +176,7 @@ func NewServer(name string, path string, transporter Transporter, stateMachine S
|
||||
return c.Apply(&context{
|
||||
server: s,
|
||||
currentTerm: s.currentTerm,
|
||||
currentIndex: s.log.currentIndex(),
|
||||
currentIndex: s.log.internalCurrentIndex(),
|
||||
commitIndex: s.log.commitIndex,
|
||||
})
|
||||
case deprecatedCommandApply:
|
||||
|
Loading…
x
Reference in New Issue
Block a user