mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
raft: drop the raft prefix in logging
This commit is contained in:
@@ -106,7 +106,7 @@ func (u *unstable) truncateAndAppend(ents []pb.Entry) {
|
||||
// directly append
|
||||
u.entries = append(u.entries, ents...)
|
||||
case after < u.offset:
|
||||
raftLogger.Infof("raftlog: replace the unstable entries from index %d", after+1)
|
||||
raftLogger.Infof("replace the unstable entries from index %d", after+1)
|
||||
// The log is being truncated to before our current offset
|
||||
// portion, so set the offset and replace the entries
|
||||
u.offset = after + 1
|
||||
@@ -114,7 +114,7 @@ func (u *unstable) truncateAndAppend(ents []pb.Entry) {
|
||||
default:
|
||||
// truncate to after and copy to u.entries
|
||||
// then append
|
||||
raftLogger.Infof("raftlog: truncate the unstable entries to index %d", after)
|
||||
raftLogger.Infof("truncate the unstable entries to index %d", after)
|
||||
u.entries = append([]pb.Entry{}, u.slice(u.offset, after+1)...)
|
||||
u.entries = append(u.entries, ents...)
|
||||
}
|
||||
@@ -128,10 +128,10 @@ func (u *unstable) slice(lo uint64, hi uint64) []pb.Entry {
|
||||
// u.offset <= lo <= hi <= u.offset+len(u.offset)
|
||||
func (u *unstable) mustCheckOutOfBounds(lo, hi uint64) {
|
||||
if lo > hi {
|
||||
raftLogger.Panicf("raft: invalid unstable.slice %d > %d", lo, hi)
|
||||
raftLogger.Panicf("invalid unstable.slice %d > %d", lo, hi)
|
||||
}
|
||||
upper := u.offset + uint64(len(u.entries))
|
||||
if lo < u.offset || hi > upper {
|
||||
raftLogger.Panicf("raft: unstable.slice[%d,%d) out of bound [%d,%d]", lo, hi, u.offset, upper)
|
||||
raftLogger.Panicf("unstable.slice[%d,%d) out of bound [%d,%d]", lo, hi, u.offset, upper)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user