diff --git a/tsdb/engine/wal/wal.go b/tsdb/engine/wal/wal.go index b293e7387f9..a388c68db6c 100644 --- a/tsdb/engine/wal/wal.go +++ b/tsdb/engine/wal/wal.go @@ -349,7 +349,7 @@ func (l *Log) readMetadataFile(fileName string) ([]*seriesAndFields, error) { length := make([]byte, 8) for { // get the length of the compressed seriesAndFields blob - _, err := f.Read(length) + _, err := io.ReadFull(f, length) if err == io.EOF { break } else if err != nil { @@ -365,7 +365,7 @@ func (l *Log) readMetadataFile(fileName string) ([]*seriesAndFields, error) { // read in the compressed block and decod it b := make([]byte, dataLength) - _, err = f.Read(b) + _, err = io.ReadFull(f, b) if err == io.EOF { break } else if err != nil { @@ -550,7 +550,8 @@ func (l *Log) Close() error { func (l *Log) close() error { for _, p := range l.partitions { if err := p.Close(); err != nil { - return err + // log and skip so we can close the other partitions + l.logger.Println("error closing partition:", err) } }