diff --git a/CHANGELOG b/CHANGELOG index 111412550..a003f6d31 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -6,7 +6,7 @@ v0.4.6 * Various documentation improvements (#907, #882) v0.4.5 -* Flush headers immediatly on `wait=true` requests (#877) +* Flush headers immediately on `wait=true` requests (#877) * Add `ETCD_HTTP_READ_TIMEOUT` and `ETCD_HTTP_WRITE_TIMEOUT` (#880) * Add `ETCDCTL_PEERS` configuration to etcdctl (#95) * etcdctl takes stdin for mk (#91) diff --git a/client/keys_test.go b/client/keys_test.go index 1b632e6b5..85bca1afa 100644 --- a/client/keys_test.go +++ b/client/keys_test.go @@ -305,7 +305,7 @@ func TestUnmarshalSuccessfulResponse(t *testing.T) { t.Errorf("#%d: received res==%v, but expected res==%v", i, res, tt.res) continue } else if tt.res == nil { - // expected and succesfully got nil response + // expected and successfully got nil response continue } diff --git a/etcdserver/force_cluster.go b/etcdserver/force_cluster.go index 10b03ff5a..f77da48a5 100644 --- a/etcdserver/force_cluster.go +++ b/etcdserver/force_cluster.go @@ -35,7 +35,7 @@ func restartAsStandaloneNode(cfg *ServerConfig, index uint64, snapshot *raftpb.S // discard the previously uncommitted entries for i, ent := range ents { if ent.Index > st.Commit { - log.Printf("etcdserver: discarding %d uncommited WAL entries ", len(ents)-i) + log.Printf("etcdserver: discarding %d uncommitted WAL entries ", len(ents)-i) ents = ents[:i] break } diff --git a/etcdserver/server.go b/etcdserver/server.go index d1fda20d9..3f7e6a5b2 100644 --- a/etcdserver/server.go +++ b/etcdserver/server.go @@ -107,7 +107,7 @@ type Storage interface { // SaveSnap function saves snapshot to the underlying stable storage. SaveSnap(snap raftpb.Snapshot) error - // TODO: WAL should be able to control cut itself. After implement self-controled cut, + // TODO: WAL should be able to control cut itself. After implement self-controlled cut, // remove it in this interface. // Cut cuts out a new wal file for saving new state and entries. Cut() error diff --git a/pkg/testutil/testutil.go b/pkg/testutil/testutil.go index 4db6f2963..1ed37a964 100644 --- a/pkg/testutil/testutil.go +++ b/pkg/testutil/testutil.go @@ -23,7 +23,7 @@ import ( // WARNING: This is a hack. // Remove this when we are able to block/check the status of the go-routines. func ForceGosched() { - // possibility enough to sched upto 10 go routines. + // possibility enough to sched up to 10 go routines. for i := 0; i < 10000; i++ { runtime.Gosched() } diff --git a/raft/log_test.go b/raft/log_test.go index f85a4f9d5..55cb6fe9a 100644 --- a/raft/log_test.go +++ b/raft/log_test.go @@ -552,7 +552,7 @@ func TestLogRestore(t *testing.T) { t.Errorf("firstIndex = %d, want %d", raftLog.firstIndex(), index+1) } if raftLog.committed != index { - t.Errorf("comitted = %d, want %d", raftLog.committed, index) + t.Errorf("committed = %d, want %d", raftLog.committed, index) } if raftLog.unstable.offset != index+1 { t.Errorf("unstable = %d, want %d", raftLog.unstable, index+1) diff --git a/raft/node_test.go b/raft/node_test.go index 6f4bb0602..52fcfa15e 100644 --- a/raft/node_test.go +++ b/raft/node_test.go @@ -358,7 +358,7 @@ func TestNodeRestart(t *testing.T) { want := Ready{ HardState: emptyState, - // commit upto index commit index in st + // commit up to index commit index in st CommittedEntries: entries[:st.Commit], } @@ -393,7 +393,7 @@ func TestNodeRestartFromSnapshot(t *testing.T) { want := Ready{ HardState: emptyState, - // commit upto index commit index in st + // commit up to index commit index in st CommittedEntries: entries, } diff --git a/raft/raft_test.go b/raft/raft_test.go index 3fa855598..ca6a5eb6d 100644 --- a/raft/raft_test.go +++ b/raft/raft_test.go @@ -668,10 +668,10 @@ func TestHandleMsgApp(t *testing.T) { {pb.Message{Type: pb.MsgApp, Term: 2, LogTerm: 1, Index: 1, Commit: 4, Entries: []pb.Entry{{Index: 2, Term: 2}}}, 2, 2, false}, // Ensure 3 - {pb.Message{Type: pb.MsgApp, Term: 1, LogTerm: 1, Index: 1, Commit: 3}, 2, 1, false}, // match entry 1, commit upto last new entry 1 - {pb.Message{Type: pb.MsgApp, Term: 1, LogTerm: 1, Index: 1, Commit: 3, Entries: []pb.Entry{{Index: 2, Term: 2}}}, 2, 2, false}, // match entry 1, commit upto last new entry 2 - {pb.Message{Type: pb.MsgApp, Term: 2, LogTerm: 2, Index: 2, Commit: 3}, 2, 2, false}, // match entry 2, commit upto last new entry 2 - {pb.Message{Type: pb.MsgApp, Term: 2, LogTerm: 2, Index: 2, Commit: 4}, 2, 2, false}, // commit upto log.last() + {pb.Message{Type: pb.MsgApp, Term: 1, LogTerm: 1, Index: 1, Commit: 3}, 2, 1, false}, // match entry 1, commit up to last new entry 1 + {pb.Message{Type: pb.MsgApp, Term: 1, LogTerm: 1, Index: 1, Commit: 3, Entries: []pb.Entry{{Index: 2, Term: 2}}}, 2, 2, false}, // match entry 1, commit up to last new entry 2 + {pb.Message{Type: pb.MsgApp, Term: 2, LogTerm: 2, Index: 2, Commit: 3}, 2, 2, false}, // match entry 2, commit up to last new entry 2 + {pb.Message{Type: pb.MsgApp, Term: 2, LogTerm: 2, Index: 2, Commit: 4}, 2, 2, false}, // commit up to log.last() } for i, tt := range tests { @@ -918,7 +918,7 @@ func TestLeaderAppResp(t *testing.T) { wcommitted uint64 }{ {3, true, 0, 3, 0, 0, 0}, // stale resp; no replies - {2, true, 0, 2, 1, 1, 0}, // denied resp; leader does not commit; decrese next and send probing msg + {2, true, 0, 2, 1, 1, 0}, // denied resp; leader does not commit; decrease next and send probing msg {2, false, 2, 4, 2, 2, 2}, // accept resp; leader commits; broadcast with commit index {0, false, 0, 3, 0, 0, 0}, // ignore heartbeat replies } @@ -1223,7 +1223,7 @@ func TestSlowNodeRestore(t *testing.T) { // trigger a commit nt.send(pb.Message{From: 1, To: 1, Type: pb.MsgProp, Entries: []pb.Entry{{}}}) if follower.raftLog.committed != lead.raftLog.committed { - t.Errorf("follower.comitted = %d, want %d", follower.raftLog.committed, lead.raftLog.committed) + t.Errorf("follower.committed = %d, want %d", follower.raftLog.committed, lead.raftLog.committed) } } diff --git a/rafthttp/sender.go b/rafthttp/sender.go index 008e70673..b66eb331e 100644 --- a/rafthttp/sender.go +++ b/rafthttp/sender.go @@ -42,7 +42,7 @@ const ( type Sender interface { // StartStreaming enables streaming in the sender using the given writer, - // which provides a fast and effecient way to send appendEntry messages. + // which provides a fast and efficient way to send appendEntry messages. StartStreaming(w WriteFlusher, to types.ID, term uint64) (done <-chan struct{}, err error) Update(u string) // Send sends the data to the remote node. It is always non-blocking. diff --git a/snap/snapshotter.go b/snap/snapshotter.go index 8d9eeadc3..818df922a 100644 --- a/snap/snapshotter.go +++ b/snap/snapshotter.go @@ -124,7 +124,7 @@ func loadSnap(dir, name string) (*raftpb.Snapshot, error) { } // snapNames returns the filename of the snapshots in logical time order (from newest to oldest). -// If there is no avaliable snapshots, an ErrNoSnapshot will be returned. +// If there is no available snapshots, an ErrNoSnapshot will be returned. func (s *Snapshotter) snapNames() ([]string, error) { dir, err := os.Open(s.dir) if err != nil {