Merge pull request #1465 from influxdb/ignore_valueless_requests

Quit value-less requests as soon as possible
pull/1483/head
Philip O'Toole 2015-01-31 11:15:30 -08:00
commit 32d9872341
1 changed files with 5 additions and 5 deletions

View File

@ -1371,6 +1371,11 @@ func (s *Server) WriteSeries(database, retentionPolicy string, points []Point) (
}
name, tags, timestamp, values := points[0].Name, points[0].Tags, points[0].Timestamp, points[0].Values
// Ignore requests that have no values.
if len(values) == 0 {
return 0, nil
}
// Find the id for the series and tagset
seriesID, err := s.createSeriesIfNotExists(database, name, tags)
if err != nil {
@ -1405,11 +1410,6 @@ func (s *Server) WriteSeries(database, retentionPolicy string, points []Point) (
// Find appropriate shard within the shard group.
sh := g.ShardBySeriesID(seriesID)
// Ignore requests that have no values.
if len(values) == 0 {
return 0, nil
}
// Convert string-key/values to fieldID-key/values.
// If not all fields can be converted then send as a non-raw write series.
rawValues := m.mapValues(values)