Skip to content

_update_by_query + script do not work correctly,error:Trying to create too many scroll contexts #71618

@lizhanghu

Description

@lizhanghu

Elasticsearch version: 7.6.2

JVM:13.0.2

OS version:centeros7

This is my code

POST  recommend_index/_update_by_query  

{
               "script": {
			"source": "ctx._source.rec_doctor_id = 1"
		},
               "query": {
                    "bool": {
				"must": [{
							"terms": {
								"id": ["22222"]
							}
	        			     }]
	        		}
                           }
	     }

This code does not return the result correctly,The error message is

{
  "error": {
    "root_cause": [
      {
        "type": "exception",
        "reason": "Trying to create too many scroll contexts. Must be less than or equal to: [5000]. This limit can be set by changing the [search.max_open_scroll_context] setting."
      }
    ],
    "type": "search_phase_execution_exception",
    "reason": "Partial shards failure",
    "phase": "query",
    "grouped": true,
    "failed_shards": [
      {
        "shard": 1,
        "index": "recommend_index",
        "node": "XXX",
        "reason": {
          "type": "exception",
          "reason": "Trying to create too many scroll contexts. Must be less than or equal to: [5000]. This limit can be set by changing the [search.max_open_scroll_context] setting."
        }
      }
    ]
  },
  "status": 500
}

I'm sure the current scroll is 0

When I replace _UPDATE_BY_QUERY with _UPDATE, it updates normally

No change has been made in ES since last Friday, and suddenly an error is reported

Metadata

Metadata

Assignees

No one assigned

    Labels

    :Search/SearchSearch-related issues that do not fall into other categoriesTeam:SearchMeta label for search team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions