Skip to content

Commit

Permalink
Merge pull request #3765 from influxdb/pd-fix-wal-io-reads
Browse files Browse the repository at this point in the history
Fix reads of metadata file in WAL
  • Loading branch information
pauldix committed Aug 20, 2015
2 parents d60f9b6 + 370f008 commit 4e7631a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tsdb/engine/wal/wal.go
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,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 {
Expand All @@ -369,7 +369,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 {
Expand Down Expand Up @@ -554,7 +554,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)
}
}

Expand Down

0 comments on commit 4e7631a

Please sign in to comment.