Fix reads of metadata file in WAL

pull/3765/head
Paul Dix 2015-08-20 10:52:29 -04:00
parent 47533465a7
commit 370f008220
1 changed files with 4 additions and 3 deletions

View File

@ -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)
}
}