-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove measurement from shard index on DROP #3002
Conversation
@@ -294,6 +294,8 @@ func (s *Shard) deleteMeasurement(name string, seriesKeys []string) error { | |||
return err | |||
} | |||
|
|||
// Remove entry from shard index. | |||
delete(s.measurementFields, name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to get the write mutex on the shard before doing this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, let me do that.
3211b2e
to
2f4b089
Compare
Correct locking added. |
@@ -294,6 +294,10 @@ func (s *Shard) deleteMeasurement(name string, seriesKeys []string) error { | |||
return err | |||
} | |||
|
|||
// Remove entry from shard index. | |||
s.mu.Lock() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't seem necessary to lock for the entire function, so just doing it here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it isn't that's right
+1 |
Thanks @pauldix -- merging now. |
Remove measurement from shard index on DROP
When a measurement is DROPped, its record in the shard's inverted index must also be deleted.
Fixes issue #2955.