summaryrefslogtreecommitdiff
path: root/docs/reference/cluster/pending.asciidoc
blob: 8431507312952d2b2a9fbf27be49b16faefee67b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
[[cluster-pending]]
== Pending cluster tasks

The pending cluster tasks API returns a list of any cluster-level changes
(e.g. create index, update mapping, allocate or fail shard) which have not yet
been executed.

NOTE: This API returns a list of any pending updates to the cluster state. These are distinct from the tasks reported by the
<<tasks,Task Management API>> which include periodic tasks and tasks initiated by the user, such as node stats, search queries, or create
index requests. However, if a user-initiated task such as a create index command causes a cluster state update, the activity of this task
might be reported by both task api and pending cluster tasks API.

[source,js]
--------------------------------------------------
$ curl -XGET 'http://localhost:9200/_cluster/pending_tasks'
--------------------------------------------------

Usually this will return an empty list as cluster-level changes are usually
fast. However if there are tasks queued up, the output will look something
like this:

[source,js]
--------------------------------------------------
{
   "tasks": [
      {
         "insert_order": 101,
         "priority": "URGENT",
         "source": "create-index [foo_9], cause [api]",
         "time_in_queue_millis": 86,
         "time_in_queue": "86ms"
      },
      {
         "insert_order": 46,
         "priority": "HIGH",
         "source": "shard-started ([foo_2][1], node[tMTocMvQQgGCkj7QDHl3OA], [P], s[INITIALIZING]), reason [after recovery from shard_store]",
         "time_in_queue_millis": 842,
         "time_in_queue": "842ms"
      },
      {
         "insert_order": 45,
         "priority": "HIGH",
         "source": "shard-started ([foo_2][0], node[tMTocMvQQgGCkj7QDHl3OA], [P], s[INITIALIZING]), reason [after recovery from shard_store]",
         "time_in_queue_millis": 858,
         "time_in_queue": "858ms"
      }
  ]
}
--------------------------------------------------