Throttle a reindex operation

Auth

Change the maximum number of documents to index per second for a particular reindex operation. For example, to unthrottle to unlimited documents per second:

POST _reindex/r1A2WoRbTwKZ516z6NEs5A:36619/_rethrottle?requests_per_second=-1
		

Rethrottling that speeds up the query takes effect immediately. Rethrottling that slows down the query will take effect after completing the current batch of documents. This behavior prevents scroll timeouts.

This API follows reindex tasks across node-shutdown relocations, so callers can keep using the original task ID throughout the lifetime of the operation. The relocated task ID is also accepted and is followed transparently. In either case, returned task IDs and timings reflect the original task, not its relocated successor.

The rethrottle may not have been applied to any tasks if either node_failures or task_failures are non-empty, or if the response contains no successfully rethrottled tasks — that is, no entries under nodes (returned with the default group_by=nodes in stack) or under tasks (returned in serverless, or in stack with group_by=none or group_by=parents).

Path parameters

task_id string required

The task identifier, returned when creating a reindex task, or by listing tasks via GET /_reindex or GET /_tasks. In stack, can be either the original task ID or the task ID of the relocated task.

Query parameters

requests_per_second number required

The maximum number of documents to index per second, across the entire reindex operation (including slices). It can be either -1 to turn off throttling or any decimal number like 1.7 or 12 to throttle to that level.

Response

application/json
node_failures object[]

Node-level failures encountered while applying the rethrottle request. Will return a failed_node_exception wrapping a no_such_node_exception, if a node handling the task either never existed, or has left the cluster, and one of the following is true:

  1. The task has completed.
  2. The task cannot be found.
Note

Rethrottle handles relocations, so it should succeed if the task can be found and has not completed.

type string required

The type of error

reason union string nullable

A human-readable explanation of the error, in English.

One of: string
stack_trace string

The server stack trace. Present only if the error_trace=true parameter was sent with the request.

caused_by object
Same fields as node_failures
root_cause object[]
Same fields as node_failures
suppressed object[]
Same fields as node_failures
task_failures object[]

Per-task failures encountered while applying the rethrottle. If a rethrottle is attempted during a relocation handoff, the failure object reports status: SERVICE_UNAVAILABLE (the HTTP response itself is still 200 OK). In this case, the request can be retried until success.

task_id number required
node_id string required
status string required
reason object required
type string required

The type of error

reason union string nullable

A human-readable explanation of the error, in English.

One of: string
stack_trace string

The server stack trace. Present only if the error_trace=true parameter was sent with the request.

caused_by object
Same fields as reason in task_failures
root_cause object[]
Same fields as reason in task_failures
suppressed object[]
Same fields as reason in task_failures
tasks union oneOf

The tasks that were successfully rethrottled. Always returned in serverless. Returned with group_by=none or group_by=parents in stack.

One of:
{} ReindexTask[]
action string required
cancellable boolean required
cancelled boolean required
description string required
id number required
node string required
running_time_in_nanos number required
start_time_in_millis number required
status object required
Same fields as status in <string>
type string required
headers object required