fix(raft/log): truncate file and reset offset correctly
parent
a974bbfe4f
commit
2cd367e9d9
|
@ -168,9 +168,10 @@ func (l *Log) open(path string) error {
|
|||
if err == io.EOF {
|
||||
debugln("open.log.append: finish ")
|
||||
} else {
|
||||
if err = os.Truncate(path, readBytes); err != nil {
|
||||
if err = l.file.Truncate(readBytes); err != nil {
|
||||
return fmt.Errorf("raft.Log: Unable to recover: %v", err)
|
||||
}
|
||||
l.file.Seek(readBytes, os.SEEK_SET)
|
||||
}
|
||||
break
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue