-
Notifications
You must be signed in to change notification settings - Fork 140
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
[BUG]The exception is unfriendly(Mapper parsing exception) when k-NN circuit breaker is triggered #1424
Comments
@heemin32 how this is bug? I would consider this as an enhancement where messaging is not proper. |
It is a bug because the error message is not just vague but incorrect. If the exception is InternalException or ThrottlingException, it is not a bug. However, mapper parsing exception does not encompass circuit breaker exception but those two are entirely different exceptions. |
Following a deep dive, we throw the nested circuit breaker exception in KNNVectorFieldMapper here. This method is called within a parseCreateField method. Tracing the method calls, we eventually arrive at the parse method in the FieldMapper class of the OpenSearch repository, which calls the method in a try/catch and wraps any exception that is caught. The parsing action fails because the circuit breaker is triggered, so the exception is technically correct. There are other instances of mappers checking conditions in this method and throwing exceptions if necessary, such as ParentIdFieldMapper and DocCountFieldMapper. We have to add the circuit breaker check in this method to stop the bulk indexing from occurring. Our access to the bulk ingestion API/process is limited due to most of the logic being implemented in the core repository. The parseCreateField method allows us to check on the circuit breaker before the indexing begins, which prevents additional memory from being used when resources are limited. That being said, I think we should create a new type of exception to throw instead of an illegal state: |
Does that mean simply reducing bulk batch size could avoid the error? |
What is the bug?
During bulk indexing, when k-NN circuit breaker is triggered, client receive mapper_parsing_exception. This makes user hard to understand the actual root cause of the exception until they look in to a log file.
How can one reproduce the bug?
Do bulk indexing of documents
What is the expected behavior?
It should provide the root cause of the exception, k-NN circuit breaker in client side error message
The text was updated successfully, but these errors were encountered: