api.go
func (r *Raft) VerifyLeader() Future {
	metrics.IncrCounter([]string{"raft", "verify_leader"}, 1)
	verifyFuture := &verifyFuture{}
	verifyFuture.init()
	select {
	case <-r.shutdownCh:
		return errorFuture{ErrRaftShutdown}
	case r.verifyCh <- verifyFuture:
		return verifyFuture
	}
}
func (r *Raft) VerifyLeader() Future {
	metrics.IncrCounter([]string{"raft", "verify_leader"}, 1)
	verifyFuture := &verifyFuture{}
	verifyFuture.init()
	select {
	case <-r.shutdownCh:
		return errorFuture{ErrRaftShutdown}
	case r.verifyCh <- verifyFuture:
		return verifyFuture
	}
}
func ( r * Raft ) VerifyLeader ( ) Future { metrics . IncrCounter ( [ ] string { " " , " " } , 1 ) verifyFuture := & verifyFuture { } verifyFuture . init ( ) select { case <- r . shutdownCh : return errorFuture { ErrRaftShutdown } case r . verifyCh <- verifyFuture : return verifyFuture } }
// VerifyLeader is used to ensure the current node is still
// the leader. This can be done to prevent stale reads when a
// new leader has potentially been elected.
VerifyLeader is used to ensure the current node is still the leader . This can be done to prevent stale reads when a new leader has potentially been elected .