Skip to content

Commit

Permalink
Check for iteration errors in PurgeMissing
Browse files Browse the repository at this point in the history
Not checking for iterator errors was hiding problems with pipeline
result size limits being exceeded when PurgeMissing was being used to
recover a production database.
  • Loading branch information
Menno Smits committed May 11, 2015
1 parent 0257d5e commit b62503f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions txn/txn.go
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,9 @@ func (r *Runner) PurgeMissing(collections ...string) error {
return fmt.Errorf("error purging missing transaction %s: %v", txnId.Hex(), err)
}
}
if err := iter.Close(); err != nil {
return fmt.Errorf("transaction queue iteration error for collection %s: %v", collection, err)
}
colls[collection] = true
}

Expand All @@ -442,6 +445,9 @@ func (r *Runner) PurgeMissing(collections ...string) error {
return fmt.Errorf("error purging missing transaction %s: %v", txnId.Hex(), err)
}
}
if err := iter.Close(); err != nil {
return fmt.Errorf("transaction stash iteration error: %v", err)
}

return nil
}
Expand Down

0 comments on commit b62503f

Please sign in to comment.