influx_tsm: don't defer reader.Close() until after Open()

Fixes #5656
pull/5704/head
Joe LeGasse 2016-02-12 15:50:12 -05:00
parent 06c1c48b3b
commit 1b8fc0c154
3 changed files with 3 additions and 9 deletions

View File

@ -93,11 +93,8 @@ func (r *Reader) Open() error {
if err != nil {
return err
}
for s, _ := range r.series {
if err != nil {
return err
}
for s := range r.series {
measurement := tsdb.MeasurementFromSeriesKey(s)
fields := r.fields[tsdb.MeasurementFromSeriesKey(s)]
if fields == nil {

View File

@ -107,11 +107,8 @@ func (r *Reader) Open() error {
if err != nil {
return err
}
for s, _ := range r.series {
if err != nil {
return err
}
for s := range r.series {
measurement := tsdb.MeasurementFromSeriesKey(s)
fields := r.fields[tsdb.MeasurementFromSeriesKey(s)]
if fields == nil {

View File

@ -324,12 +324,12 @@ func convertShard(si *tsdb.ShardInfo, tr *tracker) error {
default:
return fmt.Errorf("Unsupported shard format: %v", si.FormatAsString())
}
defer reader.Close()
// Open the shard, and create a converter.
if err := reader.Open(); err != nil {
return fmt.Errorf("Failed to open %v for conversion: %v", src, err)
}
defer reader.Close()
converter := NewConverter(dst, uint32(opts.TSMSize), tr)
// Perform the conversion.