Skip to content

Commit

Permalink
Fix nil FieldCodec panic
Browse files Browse the repository at this point in the history
This commit changes FieldCodec to always be non-nil. Normally it should
always be non-nil, however, if metadata is not persisted correctly or
consistently then it could be missing. A nil FieldCodec causes queries
to panic.

Fixes #3535
  • Loading branch information
benbjohnson committed Aug 14, 2015
1 parent 582e828 commit 45ea87c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ There are breaking changes in this release. Please see the *Features* section be
- [#3651](https://github.com/influxdb/influxdb/pull/3651): Fully remove series when dropped.
- [#3517](https://github.com/influxdb/influxdb/pull/3517): Batch CQ writes to avoid timeouts. Thanks @dim.
- [#3522](https://github.com/influxdb/influxdb/pull/3522): Consume CQ results on request timeouts. Thanks @dim.
- [#3646](https://github.com/influxdb/influxdb/pull/3646): Fix nil FieldCodec panic.

## v0.9.2 [2015-07-24]

Expand Down
2 changes: 1 addition & 1 deletion tsdb/shard.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func (s *Shard) FieldCodec(measurementName string) *FieldCodec {
defer s.mu.RUnlock()
m := s.measurementFields[measurementName]
if m == nil {
return nil
return NewFieldCodec(nil)
}
return m.Codec
}
Expand Down

0 comments on commit 45ea87c

Please sign in to comment.