Error Message "Trying to create too many scroll contexts" Is Displayed When the update-by-query Command Is Executed
Symptom
When I run the update-by-query command in an Elasticsearch cluster, the error message "Trying to create too many scroll contexts." is displayed. The specific error information is as follows:
{"error":{"root_cause":[{"type":"exception","reason":"Trying to create too many scroll contexts. Must be less than or equal to: [100000]. This limit can be set by changing the [search.max_open_scroll_context] setting."},{"type":"exception","reason":"Trying to create too many scroll contexts. Must be less than or equal to: [100000]. ......
Possible Causes
Each time a cluster calls the scroll creation API, a scroll context is created. When the number of scroll contexts reaches the preset threshold, no more scrolls can be created.
Procedure
GET /_nodes/stats/indices/search
When the value reaches the upper limiter, use either of the following methods to solve the problem.
- Method 1: Delete unnecessary scrolls to release the storage space of scroll contexts.
DELETE /_search/scroll { "scroll_id" : "DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ=="}
- Method 2: Change the value of search.max_open_scroll_context to increase the storage space for scroll contexts.
PUT /_cluster/settings { "persistent" : { "search.max_open_scroll_context": 2012345678 }, "transient": { "search.max_open_scroll_context": 2012345678 } }
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot