mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
raft: introduce log storage interface.
This change splits the raftLog.entries array into an in-memory "unstable" list and a pluggable interface for retrieving entries that have been persisted to disk. An in-memory implementation of this interface is provided which behaves the same as the old version; in a future commit etcdserver could replace the MemoryStorage with one backed by the WAL.
This commit is contained in:
@@ -60,7 +60,7 @@ func mustTemp(pre, body string) string {
|
||||
func ltoa(l *raftLog) string {
|
||||
s := fmt.Sprintf("committed: %d\n", l.committed)
|
||||
s += fmt.Sprintf("applied: %d\n", l.applied)
|
||||
for i, e := range l.ents {
|
||||
for i, e := range l.allEntries() {
|
||||
s += fmt.Sprintf("#%d: %+v\n", i, e)
|
||||
}
|
||||
return s
|
||||
|
||||
Reference in New Issue
Block a user