-
-
Notifications
You must be signed in to change notification settings - Fork 709
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
add memory limit for aggregations #1942
Conversation
ebabd4d
to
1d305c5
Compare
1d305c5
to
8b49378
Compare
fn memory_consumption(&self) -> usize; | ||
} | ||
|
||
impl<K, V, S> MemoryConsumption for HashMap<K, V, S> { |
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.
impl<K, V, S> MemoryConsumption for HashMap<K, V, S> { | |
impl<K: Copy, V: Copy, S> MemoryConsumption for HashMap<K, V, S> { |
#[error("Date histogram parse error: {0:?}")] | ||
DateHistogramParseError(#[from] DateHistogramParseError), | ||
/// Memory limit exceeded | ||
#[error( | ||
"Aborting aggregation because memory limit was exceeded. Limit: {limit:?}, Current: \ |
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.
that would be nice to display a value expressed in MB, with a unit.
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 changed the existing ByteCount
to cover that
@@ -55,7 +55,7 @@ impl fmt::Debug for DataCorruption { | |||
#[derive(Debug, Clone, Error)] | |||
pub enum TantivyError { | |||
/// Error when handling aggregations. | |||
#[error("AggregationError {0:?}")] | |||
#[error(transparent)] |
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.
ah cool ! I did not know about transparent
introduce AggregationLimits to set memory consumption limit and bucket limits memory limit is checked during aggregation, bucket limit is checked before returning the aggregation request.
Co-authored-by: Paul Masurel <[email protected]>
81c523a
to
384592f
Compare
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## main #1942 +/- ##
========================================
Coverage 94.48% 94.48%
========================================
Files 309 311 +2
Lines 56999 57207 +208
========================================
+ Hits 53855 54054 +199
- Misses 3144 3153 +9
... and 4 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
introduce AggregationLimits to set memory consumption limit and bucket limits
memory limit is checked during aggregation, bucket limit is checked before returning the aggregation request.
TODO: add check for term aggregation