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
Elasticsearch hangs using phrase suggester with collate option #9377
Comments
Please could you provide the simplest complete recreation of the problem, so that we can try it out:
thanks |
Hi here is the data needed to reproduce the error, mapping file, elasticsarch.yml, and data https://gist.github.com/silvestrelosada/eb32afdc8c971504e45c To reproduce it you have to send seval concurrent queries, Im using jmeter. Best |
If it is helps the issue takes place on multi shard enviroment in fetchMatchingDocCountResponses method when executing the search. |
Hi, I think I have the same issue. ES hangs when I send multiple simultaneous suggest requests with collate option to the search API. I tested the version 1.37 and 1.42 of ES. ES is running with one node and the default settings (5 shards per index, but 0 replica). There are about 19 000 documents in the target index. To make ES hang, I created a script which run a lot of suggest requests with random text. When I launch 2 or more instances of this script, depending on the hardware configuration of my testing environment, ES hangs and my ES client (elasticsearch-py) raises timeout exceptions. Then, I'm unable to make curl request to the search API (it's keep waiting for a response). Index API and bulk API are still running fine. ES log gives nothing. Here is an exemple of a request :
Here is the mapping of the suggest field :
I remain available for any further information. Best Regards, |
@areek could you take a look at this please |
@areek can you try to write a test to reproduce this? |
one idea that I have here is that it seem it only happens if we specify the suggest together with a search and that means the suggestion as well as the collation is executed on the search threadpool @areek can you try to write a test that does the same and try to forcefully reduce the number of threads in the search threadpool to a small number ie 1 or 2? I guess that could trigger the issue... |
I have been able to reproduce this issue. One solution to avoid this issue would be to execute the collate query on only the local shard from which the suggestions are generated instead of collating on non-local shards. As suggestions are generated from the terms of the local shard, in most cases a generated suggestion which does not yield a hit for the collate query on the local shard would not yield a hit for collate query on non-local shards. Thoughts? I will create a PR for this. |
I like this a lot - i think it's the right tradeoff |
…al shard. Previously, collate feature would be executed on all shards of an index using the client, this leads to a deadlock when concurrent collate requests are run from the _search API, due to the fact that both the external request and internal collate requests use the same search threadpool. As phrase suggestions are generated from the terms of the local shard, in most cases the generated suggestion, which does not yield a hit for the collate query on the local shard would not yield a hit for collate query on non-local shards. This commit removes the ability to specify a `preference` for a collate query, as the collate query is only run on the local shard. closes elastic#9377
…al shard. Previously, collate feature would be executed on all shards of an index using the client, this leads to a deadlock when concurrent collate requests are run from the _search API, due to the fact that both the external request and internal collate requests use the same search threadpool. As phrase suggestions are generated from the terms of the local shard, in most cases the generated suggestion, which does not yield a hit for the collate query on the local shard would not yield a hit for collate query on non-local shards. Instead of using the client for collating suggestions, collate query is executed against the ContextIndexSearcher. This PR removes the ability to specify a preference for a collate query, as the collate query is only run on the local shard. closes elastic#9377
…al shard. Previously, collate feature would be executed on all shards of an index using the client, this leads to a deadlock when concurrent collate requests are run from the _search API, due to the fact that both the external request and internal collate requests use the same search threadpool. As phrase suggestions are generated from the terms of the local shard, in most cases the generated suggestion, which does not yield a hit for the collate query on the local shard would not yield a hit for collate query on non-local shards. Instead of using the client for collating suggestions, collate query is executed against the ContextIndexSearcher. This PR removes the ability to specify a preference for a collate query, as the collate query is only run on the local shard. closes elastic#9377
…al shard. Previously, collate feature would be executed on all shards of an index using the client, this leads to a deadlock when concurrent collate requests are run from the _search API, due to the fact that both the external request and internal collate requests use the same search threadpool. As phrase suggestions are generated from the terms of the local shard, in most cases the generated suggestion, which does not yield a hit for the collate query on the local shard would not yield a hit for collate query on non-local shards. Instead of using the client for collating suggestions, collate query is executed against the ContextIndexSearcher. This PR removes the ability to specify a preference for a collate query, as the collate query is only run on the local shard. closes elastic#9377
…al shard. Previously, collate feature would be executed on all shards of an index using the client, this leads to a deadlock when concurrent collate requests are run from the _search API, due to the fact that both the external request and internal collate requests use the same search threadpool. As phrase suggestions are generated from the terms of the local shard, in most cases the generated suggestion, which does not yield a hit for the collate query on the local shard would not yield a hit for collate query on non-local shards. Instead of using the client for collating suggestions, collate query is executed against the ContextIndexSearcher. This PR removes the ability to specify a preference for a collate query, as the collate query is only run on the local shard. closes elastic#9377
…al shard. Previously, collate feature would be executed on all shards of an index using the client, this leads to a deadlock when concurrent collate requests are run from the _search API, due to the fact that both the external request and internal collate requests use the same search threadpool. As phrase suggestions are generated from the terms of the local shard, in most cases the generated suggestion, which does not yield a hit for the collate query on the local shard would not yield a hit for collate query on non-local shards. Instead of using the client for collating suggestions, collate query is executed against the ContextIndexSearcher. This PR removes the ability to specify a preference for a collate query, as the collate query is only run on the local shard. closes #9377
Hi I have elasticsearch installation single node with 100 documents, making simultaneously requests to phrase suggester with collate option blocks completely elastic search. And does gives the option to do any thing else.
Here is my query
And here is my mappings.
The text was updated successfully, but these errors were encountered: