mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
*: fix typo
This commit is contained in:
parent
45b9cb170d
commit
54a45ba2f5
@ -16,7 +16,7 @@ package raft
|
|||||||
|
|
||||||
import pb "github.com/coreos/etcd/raft/raftpb"
|
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
|
// Note that unstable.offset may be less than the highest log
|
||||||
// position in storage; this means that the next write to storage
|
// position in storage; this means that the next write to storage
|
||||||
// might need to truncate the log before persisting unstable.entries.
|
// might need to truncate the log before persisting unstable.entries.
|
||||||
@ -80,7 +80,7 @@ func (u *unstable) stableTo(i, t uint64) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
// if i < offest, term is matched with the snapshot
|
// 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.
|
// an unstable entry.
|
||||||
if gt == t && i >= u.offset {
|
if gt == t && i >= u.offset {
|
||||||
u.entries = u.entries[i+1-u.offset:]
|
u.entries = u.entries[i+1-u.offset:]
|
||||||
|
@ -53,7 +53,7 @@ const (
|
|||||||
calldepth = 2
|
calldepth = 2
|
||||||
)
|
)
|
||||||
|
|
||||||
// DefaultLogger is a defualt implementation of the Logger interface.
|
// DefaultLogger is a default implementation of the Logger interface.
|
||||||
type DefaultLogger struct {
|
type DefaultLogger struct {
|
||||||
*log.Logger
|
*log.Logger
|
||||||
debug bool
|
debug bool
|
||||||
|
@ -913,7 +913,7 @@ func commitNoopEntry(r *raft, s *MemoryStorage) {
|
|||||||
}
|
}
|
||||||
r.Step(acceptAndReply(m))
|
r.Step(acceptAndReply(m))
|
||||||
}
|
}
|
||||||
// ignore further messages to refresh followers' commmit index
|
// ignore further messages to refresh followers' commit index
|
||||||
r.readMessages()
|
r.readMessages()
|
||||||
s.Append(r.raftLog.unstableEntries())
|
s.Append(r.raftLog.unstableEntries())
|
||||||
r.raftLog.appliedTo(r.raftLog.committed)
|
r.raftLog.appliedTo(r.raftLog.committed)
|
||||||
|
@ -220,7 +220,7 @@ func (rn *RawNode) ReportUnreachable(id uint64) {
|
|||||||
_ = rn.raft.Step(pb.Message{Type: pb.MsgUnreachable, From: id})
|
_ = 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) {
|
func (rn *RawNode) ReportSnapshot(id uint64, status SnapshotStatus) {
|
||||||
rej := status == SnapshotFailure
|
rej := status == SnapshotFailure
|
||||||
|
|
||||||
|
@ -105,7 +105,7 @@ func (ms *MemoryStorage) Entries(lo, hi, maxSize uint64) ([]pb.Entry, error) {
|
|||||||
return nil, ErrCompacted
|
return nil, ErrCompacted
|
||||||
}
|
}
|
||||||
if hi > ms.lastIndex()+1 {
|
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.
|
// only contains dummy entries.
|
||||||
if len(ms.ents) == 1 {
|
if len(ms.ents) == 1 {
|
||||||
|
@ -65,7 +65,7 @@ type Peer interface {
|
|||||||
|
|
||||||
// update updates the urls of remote peer.
|
// update updates the urls of remote peer.
|
||||||
update(urls types.URLs)
|
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
|
// stream usage. After the call, the ownership of the outgoing
|
||||||
// connection hands over to the peer. The peer will close the connection
|
// connection hands over to the peer. The peer will close the connection
|
||||||
// when it is no longer used.
|
// 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 }
|
func (p *peer) activeSince() time.Time { return p.status.activeSince }
|
||||||
|
|
||||||
// Pause pauses the peer. The peer will simply drops all incoming
|
// 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() {
|
func (p *peer) Pause() {
|
||||||
select {
|
select {
|
||||||
case p.pausec <- struct{}{}:
|
case p.pausec <- struct{}{}:
|
||||||
|
@ -224,7 +224,7 @@ func (cw *streamWriter) stop() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// streamReader is a long-running go-routine that dials to the remote stream
|
// 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 {
|
type streamReader struct {
|
||||||
tr http.RoundTripper
|
tr http.RoundTripper
|
||||||
picker *urlPicker
|
picker *urlPicker
|
||||||
|
Loading…
x
Reference in New Issue
Block a user