Skip to content
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

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

Closed
lizhanghu opened this issue Apr 13, 2021 · 3 comments
Labels
:Search/Search Search-related issues that do not fall into other categories Team:Search Meta label for search team

Comments

@lizhanghu
Copy link

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

@lizhanghu lizhanghu added >bug needs:triage Requires assignment of a team area label labels Apr 13, 2021
@lizhanghu
Copy link
Author

follow-up:
I set the search.max_open_scroll_context parameter to 5000 and found nothing to do with it.
I looked up the 7.6.2 release and found that someone was having the same problem as me.Link on this
here #71354 #56202
I guess this is due to scrolling triggering the 7.6.2 bug.I restarted the cluster node without upgrading and found that it worked!!

@dnhatn
Copy link
Member

dnhatn commented Apr 15, 2021

@lizhanghu This is a known issue in 7.6.2 (see #56202). You need to upgrade to 7.7 or later to have a fix. Thank you for your interest in Elasticsearch.

@dnhatn dnhatn closed this as completed Apr 15, 2021
@dnhatn dnhatn added :Search/Search Search-related issues that do not fall into other categories and removed >bug needs:triage Requires assignment of a team area label labels Apr 15, 2021
@elasticmachine elasticmachine added the Team:Search Meta label for search team label Apr 15, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search (Team:Search)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Search/Search Search-related issues that do not fall into other categories Team:Search Meta label for search team
Projects
None yet
Development

No branches or pull requests

3 participants