Skip to content

GetTaskResponse does not expose Failures for reindex task #3963

@octocat-mona

Description

@octocat-mona

NEST/Elasticsearch.Net version:
7.0.1

Elasticsearch version:
7.2.0

Description of the problem including expected versus actual behavior:
Expected:

  • IsValid to be false when "failures" : [] response is not empty (just like ReindexOnServerResponse.IsValid
  • Be able to read the response.failures of a reindex task

Actual:

  • IsValid is true when "failures" : [] is not empty

Steps to reproduce:

  1. Index documents into source index
  2. Create destination index with 0 replicas
  3. Create reindex task with WaitForCompletion(false)
  4. Poll status using GetTaskAsync using the TaskId and check IsValid and Completed
  5. Disconnect data node containing the shards of the indices

Response from _tasks/<id> includes failures (removed some fields for readability):

{
  "completed" : true,
  "task" : {
    "action" : "indices:data/write/reindex",
    "status" : {
      "total" : 2695491,
      "updated" : 0,
      "created" : 0,
      "deleted" : 0,
      "batches" : 499,
      "version_conflicts" : 498000,
      "noops" : 0
    },
    "description" : "reindex from [my-index-1] to [my-index-2]",
    "cancellable" : true
  },
  "response" : {
    "took" : 656338,
    "timed_out" : false,
    "total" : 2695491,
    "updated" : 0,
    "created" : 0,
    "deleted" : 0,
    "batches" : 499,
    "version_conflicts" : 498000,
    "noops" : 0,
    "failures" : [
      {
        "index" : "my-index-2",
        "type" : "_doc",
        "id" : "bowFbmoBnnQlcVPVmn7H",
        "cause" : {
          "type" : "node_not_connected_exception",
          "reason" : "[instance-0000000070][1.2.3.4:19437] Node not connected"
        },
        "status" : 500
      }
    ]
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions