Explorar o código

wal: fix append entry

Xiang Li %!s(int64=11) %!d(string=hai) anos
pai
achega
43c9ca895b
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      wal/wal.go

+ 1 - 1
wal/wal.go

@@ -154,7 +154,7 @@ func (w *WAL) LoadNode() (*Node, error) {
 			if err != nil {
 			if err != nil {
 				return nil, err
 				return nil, err
 			}
 			}
-			ents = append(ents, e)
+			ents = append(ents[:e.Index-1], e)
 		case stateType:
 		case stateType:
 			s, err := loadState(b.d)
 			s, err := loadState(b.d)
 			if err != nil {
 			if err != nil {