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
Percolator doesn't reduce CircuitBreaker stats in every case. #5588
Percolator doesn't reduce CircuitBreaker stats in every case. #5588
Conversation
man good catch! I looked at the patch and I think we should rather introduce a special unload listener for this case and try to assert that the listener is never |
That makes sense! I'll update the PR. |
@s1monw I updated the PR. |
I wonder if it won't be cleaner to have an "Indices" level field data cache listener, that will always reduce the circuit breaker, and will always be added as a listener to the key as well. Then, we can remove the logic to reduce the circuit breaker in 2 places, and keep only the shard level stats at the shard level listener, and the indices level handling on the indices level (circuit breaker). This will also mean we won't have CirecuitBreaker in the In the future, this will also allow other indices level services to register for this if they need to. |
@kimchy This makes sense, I'll update the PR. |
+1 to move on an Indices level... |
…oked and updates indices statistics and services about field data loading and unloading. Moved the circuit breaker memory reducing logic to the IndicesFieldDataCacheListener, so it always reduces the memory used when field data gets unloaded, this fixes a issue where the circuit breaker didn't get reduced when segments where no shardId could be resolved get cleared up. Also made sure that exceptions in the percolator service are bubbled up properly. Closes elastic#5588
} | ||
|
||
@Override | ||
public void onUnload(FieldMapper.Names fieldNames, FieldDataType fieldDataType, boolean wasEvicted, long sizeInBytes, @Nullable AtomicFieldData fieldData) { |
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.
should this assert that the size is positive?
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.
The assert makes sense, let me add it
one small comment - LGTM otherwise |
…oked and updates indices statistics and services about field data loading and unloading. Moved the circuit breaker memory reducing logic to the IndicesFieldDataCacheListener, so it always reduces the memory used when field data gets unloaded, this fixes a issue where the circuit breaker didn't get reduced when segments where no shardId could be resolved get cleared up. Also made sure that exceptions in the percolator service are bubbled up properly. Closes #5588
…oked and updates indices statistics and services about field data loading and unloading. Moved the circuit breaker memory reducing logic to the IndicesFieldDataCacheListener, so it always reduces the memory used when field data gets unloaded, this fixes a issue where the circuit breaker didn't get reduced when segments where no shardId could be resolved get cleared up. Also made sure that exceptions in the percolator service are bubbled up properly. Closes #5588
…oked and updates indices statistics and services about field data loading and unloading. Moved the circuit breaker memory reducing logic to the IndicesFieldDataCacheListener, so it always reduces the memory used when field data gets unloaded, this fixes a issue where the circuit breaker didn't get reduced when segments where no shardId could be resolved get cleared up. Also made sure that exceptions in the percolator service are bubbled up properly. Closes #5588
…oked and updates indices statistics and services about field data loading and unloading. Moved the circuit breaker memory reducing logic to the IndicesFieldDataCacheListener, so it always reduces the memory used when field data gets unloaded, this fixes a issue where the circuit breaker didn't get reduced when segments where no shardId could be resolved get cleared up. Also made sure that exceptions in the percolator service are bubbled up properly. Closes elastic#5588
…oked and updates indices statistics and services about field data loading and unloading. Moved the circuit breaker memory reducing logic to the IndicesFieldDataCacheListener, so it always reduces the memory used when field data gets unloaded, this fixes a issue where the circuit breaker didn't get reduced when segments where no shardId could be resolved get cleared up. Also made sure that exceptions in the percolator service are bubbled up properly. Closes elastic#5588
incase if I have a diffferent types and having a common name of a field created by.When I querying with that field with respect to a particular type , will it load the data from all type to the heap memory or only from the type which i have refered. due to this frequent circuitbreaker exception occuring.. please answer |
In the case a filter / query is in a percolator query that uses FieldData, after percolating when the in-memory index gets cleared up the circuit breaker stats don't get reduced. Resulting in a discrepancy between what fielddata and the circuit breaker are reporting.
The fix makes sure that the circuit breaker stats gets reduced even for a segment no shard id can be found, which is the case for the in-memory index the percolator is used to percolate documents.