bump(github.com/coreos/raft): ca61124b291fe38a2ab592a8b42f1423e3c31cc4
This commit is contained in:
@ -2,8 +2,7 @@ package raft
|
|||||||
|
|
||||||
// Join command interface
|
// Join command interface
|
||||||
type JoinCommand interface {
|
type JoinCommand interface {
|
||||||
CommandName() string
|
Command
|
||||||
Apply(server Server) (interface{}, error)
|
|
||||||
NodeName() string
|
NodeName() string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,8 +2,7 @@ package raft
|
|||||||
|
|
||||||
// Leave command interface
|
// Leave command interface
|
||||||
type LeaveCommand interface {
|
type LeaveCommand interface {
|
||||||
CommandName() string
|
Command
|
||||||
Apply(server Server) (interface{}, error)
|
|
||||||
NodeName() string
|
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 {
|
func (l *Log) currentIndex() uint64 {
|
||||||
l.mutex.RLock()
|
l.mutex.RLock()
|
||||||
defer l.mutex.RUnlock()
|
defer l.mutex.RUnlock()
|
||||||
|
return l.internalCurrentIndex()
|
||||||
if len(l.entries) == 0 {
|
|
||||||
return l.startIndex
|
|
||||||
}
|
|
||||||
return l.entries[len(l.entries)-1].Index
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// The current index in the log without locking
|
// 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{
|
return c.Apply(&context{
|
||||||
server: s,
|
server: s,
|
||||||
currentTerm: s.currentTerm,
|
currentTerm: s.currentTerm,
|
||||||
currentIndex: s.log.currentIndex(),
|
currentIndex: s.log.internalCurrentIndex(),
|
||||||
commitIndex: s.log.commitIndex,
|
commitIndex: s.log.commitIndex,
|
||||||
})
|
})
|
||||||
case deprecatedCommandApply:
|
case deprecatedCommandApply:
|
||||||
|
Reference in New Issue
Block a user