From 9a802763596bea749770b1fe9379981d6057cf24 Mon Sep 17 00:00:00 2001 From: hustjieke Date: Fri, 22 Mar 2019 17:57:42 +0800 Subject: [PATCH] src: fix some misspell errors issue #63 --- src/config/config.go | 2 +- src/model/mysql.go | 2 +- src/raft/candidate.go | 4 ++-- src/raft/mock.go | 4 ++-- src/raft/raft_test.go | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/config/config.go b/src/config/config.go index b32d4a4..f13e5f3 100644 --- a/src/config/config.go +++ b/src/config/config.go @@ -220,7 +220,7 @@ type BackupConfig struct { // mysql host Host string - // mysql prot + // mysql port Port int // mysql basedir diff --git a/src/model/mysql.go b/src/model/mysql.go index cd31cc9..ee1d615 100644 --- a/src/model/mysql.go +++ b/src/model/mysql.go @@ -29,7 +29,7 @@ type GTID struct { // Mysql master log file which the slave is reading Master_Log_File string - // Mysql master log postion which the slave has read + // Mysql master log position which the slave has read Read_Master_Log_Pos uint64 // The name of the master binary log file containing the most recent event executed by the SQL thread diff --git a/src/raft/candidate.go b/src/raft/candidate.go index 43d29a7..6c4d246 100644 --- a/src/raft/candidate.go +++ b/src/raft/candidate.go @@ -62,7 +62,7 @@ func (r *Candidate) Loop() { r.resetElectionTimeout() r.resetCheckVotesTimeout() - // boradcast voterequest + // broadcast voterequest voteGranted := 1 idleVoted := 0 respChan := make(chan *model.RaftRPCResponse, r.getMembers()) @@ -86,7 +86,7 @@ func (r *Candidate) Loop() { r.resetCheckVotesTimeout() case <-r.electionTick.C: voteGranted = 1 - // boradcast voterequest + // broadcast voterequest respChan = make(chan *model.RaftRPCResponse, r.getMembers()) r.sendRequestVoteHandler(respChan) diff --git a/src/raft/mock.go b/src/raft/mock.go index f3bfa73..a1dcf01 100644 --- a/src/raft/mock.go +++ b/src/raft/mock.go @@ -133,7 +133,7 @@ func MockWaitMySQLPingTimeout() { func MockWaitLeaderEggs(rafts []*Raft, leadernums int) int { // wait if leadernums == 0 { - // wait hearbeat boradcast + // wait hearbeat broadcast time.Sleep(time.Millisecond * time.Duration(rafts[0].getElectionTimeout()*2)) return -1 } @@ -147,7 +147,7 @@ func MockWaitLeaderEggs(rafts []*Raft, leadernums int) int { if raft.getState() == LEADER { nums++ if nums == leadernums { - // wait hearbeat boradcast + // wait hearbeat broadcast time.Sleep(time.Millisecond * time.Duration(rafts[0].getElectionTimeout())) done <- i return diff --git a/src/raft/raft_test.go b/src/raft/raft_test.go index 3ada7b2..c380900 100644 --- a/src/raft/raft_test.go +++ b/src/raft/raft_test.go @@ -251,7 +251,7 @@ func TestRaftLeaderDown(t *testing.T) { // 5. Stop cluster1.leader // 6. Stop cluster2.follower // 6. wait cluster1.candidate eggs -// 8. cluster2.leader add cluster1.candidate as his peers and boradcast heartbeat to him +// 8. cluster2.leader add cluster1.candidate as his peers and broadcast heartbeat to him // 9. cluster1.candidate give an ErrorInvalidRequest to cluster2.leader, since you are not a member of cluster1 // 10. cluster1.candidate add cluster2.leader as his peers // 11. cluster2.leader get a requestvote from cluster1.candidate