mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
change func para due to the api change in go-raft
This commit is contained in:
parent
0c2ffa84af
commit
6c6f94fedd
10
etcd.go
10
etcd.go
@ -225,6 +225,9 @@ func startRaft(securityType int) {
|
|||||||
raftServer.SetElectionTimeout(ELECTIONTIMTOUT)
|
raftServer.SetElectionTimeout(ELECTIONTIMTOUT)
|
||||||
raftServer.SetHeartbeatTimeout(HEARTBEATTIMEOUT)
|
raftServer.SetHeartbeatTimeout(HEARTBEATTIMEOUT)
|
||||||
|
|
||||||
|
// start to response to raft requests
|
||||||
|
go startRaftTransport(info.RaftPort, securityType)
|
||||||
|
|
||||||
if raftServer.IsLogEmpty() {
|
if raftServer.IsLogEmpty() {
|
||||||
|
|
||||||
// start as a leader in a new cluster
|
// start as a leader in a new cluster
|
||||||
@ -249,7 +252,7 @@ func startRaft(securityType int) {
|
|||||||
|
|
||||||
// start as a follower in a existing cluster
|
// start as a follower in a existing cluster
|
||||||
} else {
|
} else {
|
||||||
raftServer.StartFollower()
|
raftServer.StartFollower(false)
|
||||||
|
|
||||||
for _, machine := range cluster {
|
for _, machine := range cluster {
|
||||||
if len(machine) == 0 {
|
if len(machine) == 0 {
|
||||||
@ -270,7 +273,7 @@ func startRaft(securityType int) {
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
// rejoin the previous cluster
|
// rejoin the previous cluster
|
||||||
raftServer.StartFollower()
|
raftServer.StartFollower(true)
|
||||||
debug("%s restart as a follower", raftServer.Name())
|
debug("%s restart as a follower", raftServer.Name())
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -279,9 +282,6 @@ func startRaft(securityType int) {
|
|||||||
go raftServer.Snapshot()
|
go raftServer.Snapshot()
|
||||||
}
|
}
|
||||||
|
|
||||||
// start to response to raft requests
|
|
||||||
go startRaftTransport(info.RaftPort, securityType)
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create transporter using by raft server
|
// Create transporter using by raft server
|
||||||
|
Loading…
x
Reference in New Issue
Block a user