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

$this->client->updateByQuery($params); do not work correctly,error:Trying to create too many scroll contexts #1125

Closed
lizhanghu opened this issue Apr 14, 2021 · 2 comments

Comments

@lizhanghu
Copy link

lizhanghu commented Apr 14, 2021

This is my code


$this->client->updateByQuery($params); 

The printed log is

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


- centeros7
- PHP Version 7.1
- ES-PHP client version 7.7
- Elasticsearch version  7.6.2
@ezimuel
Copy link
Contributor

ezimuel commented Apr 15, 2021

@lizhanghu it seems this is a bug that has been fixed in 7.7 (see elastic/elasticsearch#56202). Can you try to update Elasticsearch and try again? Thanks!

@lizhanghu
Copy link
Author

@lizhanghu it seems this is a bug that has been fixed in 7.7 (see elastic/elasticsearch#56202). Can you try to update Elasticsearch and try again? Thanks!

OK, now we have restarted the cluster and it is working properly and we are preparing to upgrade,thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants