Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix reads of metadata file in WAL #3765

Merged
merged 1 commit into from
Aug 20, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions tsdb/engine/wal/wal.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down Expand Up @@ -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)
}
}

Expand Down