Skip to content

Commit

Permalink
RUnlock server after dropping series
Browse files Browse the repository at this point in the history
  • Loading branch information
otoolep committed Apr 27, 2015
1 parent a1a2f60 commit fe1a6d2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
7 changes: 4 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## v0.9.0-rc28 [unreleased]

### Features
- [#2410](https://github.com/influxdb/influxdb/pull/2410) Allow configuration of Raft timers

### Bugfixes
- [#2374](https://github.com/influxdb/influxdb/issues/2374): Two different panics during SELECT percentile
- [#2404](https://github.com/influxdb/influxdb/pull/2404): Mean and percentile function fixes
Expand All @@ -11,9 +14,7 @@
- [#2426](https://github.com/influxdb/influxdb/pull/2426): Fix race condition around listener address in Graphite server.
- [#2429](https://github.com/influxdb/influxdb/pull/2429): Ensure no field value is null.
- [#2431](https://github.com/influxdb/influxdb/pull/2431): Always append shard path in diags. Thanks @marcosnils

### Features
- [#2410](https://github.com/influxdb/influxdb/pull/2410) Allow configuration of Raft timers
- [#2431](https://github.com/influxdb/influxdb/pull/2431): RUnlock server after dropping series

## v0.9.0-rc27 [04-23-2015]

Expand Down
5 changes: 1 addition & 4 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -2500,6 +2500,7 @@ func (s *Server) executeDropMeasurementStatement(stmt *influxql.DropMeasurementS

func (s *Server) executeDropSeriesStatement(stmt *influxql.DropSeriesStatement, database string, user *User) *Result {
s.mu.RLock()
defer s.mu.RUnlock()

seriesByMeasurement := make(map[string][]uint64)
// Handle the simple `DROP SERIES <id>` case.
Expand All @@ -2512,7 +2513,6 @@ func (s *Server) executeDropSeriesStatement(stmt *influxql.DropSeriesStatement,
}
}

s.mu.RUnlock()
return &Result{Err: s.DropSeries(database, seriesByMeasurement)}
}

Expand All @@ -2521,14 +2521,12 @@ func (s *Server) executeDropSeriesStatement(stmt *influxql.DropSeriesStatement,
// Find the database.
db := s.databases[database]
if db == nil {
s.mu.RUnlock()
return &Result{Err: ErrDatabaseNotFound(database)}
}

// Get the list of measurements we're interested in.
measurements, err := measurementsFromSourceOrDB(stmt.Source, db)
if err != nil {
s.mu.RUnlock()
return &Result{Err: err}
}

Expand All @@ -2550,7 +2548,6 @@ func (s *Server) executeDropSeriesStatement(stmt *influxql.DropSeriesStatement,

seriesByMeasurement[m.Name] = ids
}
s.mu.RUnlock()

return &Result{Err: s.DropSeries(database, seriesByMeasurement)}
}
Expand Down

0 comments on commit fe1a6d2

Please sign in to comment.