Files
honeymoose f321dfedf5 同步完成!
**同步结果摘要**:

| 目录 | 同步前 | 同步后 | 官方 |
|------|--------|--------|------|
| aggregations | 40 | 65 | 64 |
| analyzers | 8 | 141 | 140 |
| api-reference | 97 | 186 | 174 |
| benchmark | 34 | 67 | 53 |
| clients | 17 | 18 | 18 |
| dashboards | 38 | 149 | 131 |
| data-prepper | 77 | 134 | 123 |
| im-plugin | 22 | 37 | 37 |
| ingest-pipelines | 27 | 52 | 51 |
| install-and-configure | 37 | 57 | 53 |
| ml-commons-plugin | 81 | 157 | 155 |
| observing-your-data | 39 | 73 | 66 |
| query-dsl | 40 | 77 | 75 |
| search-plugins | 80 | 139 | 95 |
| security-analytics | 22 | 47 | 46 |

**说明**:
- 本地文件数 > 官方:本地有一些官方已删除或重命名的文件
- 新增了约 **740 个英文文档文件**
- 已有文件保持不变(未覆盖)
2026-11-30 10:48:30 -05:00

3.6 KiB

layout, title, nav_order, parent, has_children
layout title nav_order parent has_children
default Cluster pending tasks 46 Cluster APIs false

Cluster Pending Tasks API

Introduced 1.0 {: .label .label-purple }

The /_cluster/pending_tasks API returns a list of cluster-level changes that have not yet been executed. These pending tasks are typically queued operations such as index creation, template updates, shard allocation changes, and other cluster state updates.

This API is useful for monitoring the state of the cluster and diagnosing delays in cluster state updates, especially when tasks are backed up or stuck.

Endpoint

GET /_cluster/pending_tasks

Query parameters

The following table lists the available query parameters. All query parameters are optional.

Parameter Data type Description
local Boolean Whether to return information from the local node only instead of the elected cluster manager node. Default is false.
cluster_manager_timeout Time Specifies the timeout for connecting to the cluster manager node. Default is 30s.

Example request

The following request returns the list of currently pending cluster state update tasks:

{% capture step1_rest %} GET /_cluster/pending_tasks {% endcapture %}

{% capture step1_python %}

response = client.cluster.pending_tasks() {% endcapture %}

{% include code-block.html rest=step1_rest python=step1_python %}

Example response

{
  "tasks": [
    {
      "insert_order": 1234,
      "priority": "HIGH",
      "source": "create-index [logs-2025.07.15]",
      "executing": false,
      "time_in_queue_millis": 28,
      "time_in_queue": "28ms"
    },
    {
      "insert_order": 1235,
      "priority": "URGENT",
      "source": "shard-started shard id [logs-2025.07.15][0]",
      "executing": true,
      "time_in_queue_millis": 3,
      "time_in_queue": "3ms"
    }
  ]
}

The _cluster/pending_tasks API typically returns an empty array because the tasks are normally processed too quickly to be included in the response. {: .note}

Response fields

The following table lists all response fields.

Field Data type Description
tasks Array The list of pending cluster state update tasks.
tasks[n].insert_order Integer The order in which the task was added to the queue.
tasks[n].priority String The priority level of the task (for example, HIGH, URGENT).
tasks[n].source String The description of the operation that submitted the task.
tasks[n].executing Boolean Confirmation of whether the task is currently being executed.
tasks[n].time_in_queue_millis Integer The amount of time the task has been waiting in the queue (in milliseconds).
tasks[n].time_in_queue String A human-readable version of time_in_queue_millis.

Required permissions

If you use the Security plugin, make sure you have the appropriate permissions: cluster:monitor/task.