pending.asciidoc 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. [[cluster-pending]]
  2. == Pending cluster tasks
  3. The pending cluster tasks API returns a list of any cluster-level changes
  4. (e.g. create index, update mapping, allocate or fail shard) which have not yet
  5. been executed.
  6. NOTE: This API returns a list of any pending updates to the cluster state. These are distinct from the tasks reported by the
  7. <<tasks,Task Management API>> which include periodic tasks and tasks initiated by the user, such as node stats, search queries, or create
  8. index requests. However, if a user-initiated task such as a create index command causes a cluster state update, the activity of this task
  9. might be reported by both task api and pending cluster tasks API.
  10. [source,js]
  11. --------------------------------------------------
  12. GET /_cluster/pending_tasks
  13. --------------------------------------------------
  14. // CONSOLE
  15. Usually this will return an empty list as cluster-level changes are usually
  16. fast. However if there are tasks queued up, the output will look something
  17. like this:
  18. [source,js]
  19. --------------------------------------------------
  20. {
  21. "tasks": [
  22. {
  23. "insert_order": 101,
  24. "priority": "URGENT",
  25. "source": "create-index [foo_9], cause [api]",
  26. "time_in_queue_millis": 86,
  27. "time_in_queue": "86ms"
  28. },
  29. {
  30. "insert_order": 46,
  31. "priority": "HIGH",
  32. "source": "shard-started ([foo_2][1], node[tMTocMvQQgGCkj7QDHl3OA], [P], s[INITIALIZING]), reason [after recovery from shard_store]",
  33. "time_in_queue_millis": 842,
  34. "time_in_queue": "842ms"
  35. },
  36. {
  37. "insert_order": 45,
  38. "priority": "HIGH",
  39. "source": "shard-started ([foo_2][0], node[tMTocMvQQgGCkj7QDHl3OA], [P], s[INITIALIZING]), reason [after recovery from shard_store]",
  40. "time_in_queue_millis": 858,
  41. "time_in_queue": "858ms"
  42. }
  43. ]
  44. }
  45. --------------------------------------------------
  46. // NOTCONSOLE
  47. // We can't test tasks output