pending.asciidoc 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. $ curl -XGET 'http://localhost:9200/_cluster/pending_tasks'
  13. --------------------------------------------------
  14. Usually this will return an empty list as cluster-level changes are usually
  15. fast. However if there are tasks queued up, the output will look something
  16. like this:
  17. [source,js]
  18. --------------------------------------------------
  19. {
  20. "tasks": [
  21. {
  22. "insert_order": 101,
  23. "priority": "URGENT",
  24. "source": "create-index [foo_9], cause [api]",
  25. "time_in_queue_millis": 86,
  26. "time_in_queue": "86ms"
  27. },
  28. {
  29. "insert_order": 46,
  30. "priority": "HIGH",
  31. "source": "shard-started ([foo_2][1], node[tMTocMvQQgGCkj7QDHl3OA], [P], s[INITIALIZING]), reason [after recovery from shard_store]",
  32. "time_in_queue_millis": 842,
  33. "time_in_queue": "842ms"
  34. },
  35. {
  36. "insert_order": 45,
  37. "priority": "HIGH",
  38. "source": "shard-started ([foo_2][0], node[tMTocMvQQgGCkj7QDHl3OA], [P], s[INITIALIZING]), reason [after recovery from shard_store]",
  39. "time_in_queue_millis": 858,
  40. "time_in_queue": "858ms"
  41. }
  42. ]
  43. }
  44. --------------------------------------------------