-
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
Drop measurement was taking to long due to transactions #1990
Conversation
@@ -1139,9 +1137,9 @@ func (db *database) dropMeasurement(name string) error { | |||
} | |||
|
|||
// dropSeries will delete all data with the seriesID | |||
func (rp *RetentionPolicy) dropSeries(seriesID uint32) error { | |||
func (rp *RetentionPolicy) dropSeries(seriesIDs ...uint32) error { |
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.
I'm curious about this style. More preferred/idiomatic than doing []uint32
? Or is it because you want to be able to support just passing in one ID?
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.
So, idiomatic is becoming a 4 letter word in the go community, but yes, it is to support sending a single series ID in the future.
This way, your signature for drop series would be dropSeries(id)
as opposed to dropSeries([]SeriesIDs{id})
.
This is very common to see in the standard library as well.
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.
rad, I"ll have to remember it :)
As much as I would love to see tens of thousands of BoltDB transactions, this seems like a good idea to me. |
Drop measurement was taking to long due to transactions
LGTM |
fix(http): convert scraper target error
Previously, if you had 10k series, it was creating 10k bolt transactions, which of course, takes a lot of time. Now, it creates significantly less transactions (only as many as you have shards). I was seeing results of
DROP MEASUREMENT
taking a couple minutes, and now takes less than 20ms.