Browse Source

*: fix typo

siddontang 10 years ago
parent
commit
54a45ba2f5
7 changed files with 9 additions and 9 deletions
  1. 2 2
      raft/log_unstable.go
  2. 1 1
      raft/logger.go
  3. 1 1
      raft/raft_paper_test.go
  4. 1 1
      raft/rawnode.go
  5. 1 1
      raft/storage.go
  6. 2 2
      rafthttp/peer.go
  7. 1 1
      rafthttp/stream.go

+ 2 - 2
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:]

+ 1 - 1
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

+ 1 - 1
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)

+ 1 - 1
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
 

+ 1 - 1
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 {

+ 2 - 2
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{}{}:

+ 1 - 1
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