1

I am trying to delete large-number of documents in ES via delete_by_query. But I am seeing the following errors.

Query

POST indexName/typeName/_delete_by_query
{ 
  "size": 100000,
  "query": {
    "bool": {
      "must": [
        { 
          "range": {
            "CREATED_TIME": {
              "gte": 0,
              "lte": 1507316563000
            }
          }
        }
      ]
    }
  } 
}

Result

{
  "took": 50489,
  "timed_out": false,
  "total": 100000,
  "deleted": 0,
  "batches": 1,
  "version_conflicts": 1000,
  "noops": 0,
  "retries": {
    "bulk": 0,
    "search": 0
  },
  "throttled_millis": 0,
  "requests_per_second": -1,
  "throttled_until_millis": 0,
  "failures": [
    {
      "index": "indexName",
      "type": "typeName",
      "id": "HVBLdzwnImXdVbq",
      "cause": {
        "type": "version_conflict_engine_exception",
        "reason": "[typeName][HVBLdzwnImXdVbq]: version conflict, current version [2] is different than the one provided [1]",
        "index_uuid": "YPJcVQZqQKqnuhbC9R7qHA",
        "shard": "1",
        "index": "indexName"
      },
      "status": 409
    },....

1 Answer 1

2

Please read this article.

You have two ways of handling this issue, by set the url to ignore version conflicts or set the query to ignore version conflicts:

If you’d like to count version conflicts rather than cause them to abort then set conflicts=proceed on the url or "conflicts": "proceed" in the request body.

Sign up to request clarification or add additional context in comments.

1 Comment

this does not really solve the problem. The document to be delete is actually not deleted, just skipped.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.