diff --git a/CHANGELOG.md b/CHANGELOG.md index eaebea0685..372bbebf50 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ - [#6607](https://github.com/influxdata/influxdb/issues/6607): SHOW TAG VALUES accepts != and !~ in WHERE clause. - [#6649](https://github.com/influxdata/influxdb/issues/6649): Make sure admin exists before authenticating query. - [#6644](https://github.com/influxdata/influxdb/issues/6644): Print the query executor's stack trace on a panic to the log. +- [#6650](https://github.com/influxdata/influxdb/issues/6650): Data race when dropping a database immediately after writing to it ## v0.13.0 [2016-05-12] diff --git a/tsdb/store.go b/tsdb/store.go index fcccde925e..d18ede1d1f 100644 --- a/tsdb/store.go +++ b/tsdb/store.go @@ -375,11 +375,12 @@ func (s *Store) DeleteDatabase(name string) error { for shardID, sh := range s.shards { if sh.database == name { wg.Add(1) - go func(shardID uint64) { + shardID, sh := shardID, sh // scoped copies of loop variables + go func() { defer wg.Done() err := sh.Close() responses <- resp{shardID, err} - }(shardID) + }() } } s.mu.RUnlock()