From 54a45ba2f550d2c4d3292c65e818b8644ca0a133 Mon Sep 17 00:00:00 2001 From: siddontang Date: Wed, 6 Jan 2016 16:17:02 +0800 Subject: [PATCH] *: fix typo --- raft/log_unstable.go | 4 ++-- raft/logger.go | 2 +- raft/raft_paper_test.go | 2 +- raft/rawnode.go | 2 +- raft/storage.go | 2 +- rafthttp/peer.go | 4 ++-- rafthttp/stream.go | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/raft/log_unstable.go b/raft/log_unstable.go index 7a1b2353d..5d65a6a5c 100644 --- a/raft/log_unstable.go +++ b/raft/log_unstable.go @@ -16,7 +16,7 @@ package raft import pb "github.com/coreos/etcd/raft/raftpb" -// unstable.entris[i] has raft log position i+unstable.offset. +// unstable.entries[i] has raft log position i+unstable.offset. // Note that unstable.offset may be less than the highest log // position in storage; this means that the next write to storage // might need to truncate the log before persisting unstable.entries. @@ -80,7 +80,7 @@ func (u *unstable) stableTo(i, t uint64) { return } // if i < offest, term is matched with the snapshot - // only update the unstalbe entries if term is matched with + // only update the unstable entries if term is matched with // an unstable entry. if gt == t && i >= u.offset { u.entries = u.entries[i+1-u.offset:] diff --git a/raft/logger.go b/raft/logger.go index 12be16f3c..31c194a06 100644 --- a/raft/logger.go +++ b/raft/logger.go @@ -53,7 +53,7 @@ const ( calldepth = 2 ) -// DefaultLogger is a defualt implementation of the Logger interface. +// DefaultLogger is a default implementation of the Logger interface. type DefaultLogger struct { *log.Logger debug bool diff --git a/raft/raft_paper_test.go b/raft/raft_paper_test.go index 941abbeff..ed7895023 100644 --- a/raft/raft_paper_test.go +++ b/raft/raft_paper_test.go @@ -913,7 +913,7 @@ func commitNoopEntry(r *raft, s *MemoryStorage) { } r.Step(acceptAndReply(m)) } - // ignore further messages to refresh followers' commmit index + // ignore further messages to refresh followers' commit index r.readMessages() s.Append(r.raftLog.unstableEntries()) r.raftLog.appliedTo(r.raftLog.committed) diff --git a/raft/rawnode.go b/raft/rawnode.go index 442444c5e..924601cad 100644 --- a/raft/rawnode.go +++ b/raft/rawnode.go @@ -220,7 +220,7 @@ func (rn *RawNode) ReportUnreachable(id uint64) { _ = rn.raft.Step(pb.Message{Type: pb.MsgUnreachable, From: id}) } -// ReportSnapshot reports the stutus of the sent snapshot. +// ReportSnapshot reports the status of the sent snapshot. func (rn *RawNode) ReportSnapshot(id uint64, status SnapshotStatus) { rej := status == SnapshotFailure diff --git a/raft/storage.go b/raft/storage.go index 904e185fc..fdb846c6d 100644 --- a/raft/storage.go +++ b/raft/storage.go @@ -105,7 +105,7 @@ func (ms *MemoryStorage) Entries(lo, hi, maxSize uint64) ([]pb.Entry, error) { return nil, ErrCompacted } if hi > ms.lastIndex()+1 { - raftLogger.Panicf("entries's hi(%d) is out of bound lastindex(%d)", hi, ms.lastIndex()) + raftLogger.Panicf("entries' hi(%d) is out of bound lastindex(%d)", hi, ms.lastIndex()) } // only contains dummy entries. if len(ms.ents) == 1 { diff --git a/rafthttp/peer.go b/rafthttp/peer.go index f74f5d8b0..23db9d037 100644 --- a/rafthttp/peer.go +++ b/rafthttp/peer.go @@ -65,7 +65,7 @@ type Peer interface { // update updates the urls of remote peer. update(urls types.URLs) - // attachOutgoingConn attachs the outgoing connection to the peer for + // attachOutgoingConn attaches the outgoing connection to the peer for // stream usage. After the call, the ownership of the outgoing // connection hands over to the peer. The peer will close the connection // when it is no longer used. @@ -240,7 +240,7 @@ func (p *peer) attachOutgoingConn(conn *outgoingConn) { func (p *peer) activeSince() time.Time { return p.status.activeSince } // Pause pauses the peer. The peer will simply drops all incoming -// messages without retruning an error. +// messages without returning an error. func (p *peer) Pause() { select { case p.pausec <- struct{}{}: diff --git a/rafthttp/stream.go b/rafthttp/stream.go index 393ed934f..c50afe748 100644 --- a/rafthttp/stream.go +++ b/rafthttp/stream.go @@ -224,7 +224,7 @@ func (cw *streamWriter) stop() { } // streamReader is a long-running go-routine that dials to the remote stream -// endponit and reads messages from the response body returned. +// endpoint and reads messages from the response body returned. type streamReader struct { tr http.RoundTripper picker *urlPicker