Execute reindex and the task is not found

First I execute the reindex

POST _reindex?wait_for_completion=false
{
  "conflicts": "proceed",
  "source": {
    "index": "wh_crm_student_order_2020.11.09"
  },
  "dest": {
    "index": "wh_crm_student_order_new_2020.11.09",
    "version_type": "external"
  }
}

reindex will return me 1 task ID which is yXafjEXKSu65EXqOuquJzg:2194095

Then I found that I couldn't find out the details of the task by the following request, the whole .task index is

GET /.tasks/_doc/yXafjEXKSu65EXqOuquJzg:2194095

But when I execute the following request, I can find the task I'm executing in all the tasks in the whole cluster, but I can't check only this one task by task ID, I want to understand why this happens, this situation is occasional

GET /_tasks

Try

GET /_tasks/<task_id>

GET /_tasks/yXafjEXKSu65EXqOuquJzg:2194095

I tried it, my version is 7.4.2 and it returns the following

{
  "error": "Incorrect HTTP method for uri [/.tasks/yXafjEXKSu65EXqOuquJzg:2194095?pretty] and method [GET], allowed: [POST]",
  "status": 405
}

Need to use GET /.tasks/_doc/yXafjEXKSu65EXqOuquJzg:2194095

But this time, after I executed the reindex, I was able to get a new one by using GET /.tasks/_doc/yXafjEXKSu65EXqOuquJzg:2194095 And did not check the task, But when the task is executed, after going to check, the task data can be successfully checked, I am wondering why this is?

Before the task is executed, I can be sure that the index .tasks is empty and there is no data

Same syntax in 7.4 Documents

You tried what command are you still putting the . in the command?

In general accessing the . (system indices) directly is not generally a good idea / not a supported API use at your own risk.

Directly from the 7.4 docs...

Task management API

The task management API is new and should still be considered a beta feature. The API may change in ways that are not backwards compatible.

Returns information about the tasks currently executing in the cluster.

Request

GET /_tasks/<task_id>

GET /_tasks

Oh, my bad. It should be _tasks and I wrote it as .tasks 。。。

1 Like