Skip to content

Commit 91f4b58

Browse files
authored
Deprecate REST access to System Indices (#60945)
This PR adds deprecation warnings when accessing System Indices via the REST layer. At this time, these warnings are only enabled for Snapshot builds by default, to allow projects external to Elasticsearch additional time to adjust their access patterns. Deprecation warnings will be triggered by all REST requests which access registered System Indices, except for purpose-specific APIs which access System Indices as an implementation detail a few specific APIs which will continue to allow access to system indices by default: - `GET _cluster/health` - `GET {index}/_recovery` - `GET _cluster/allocation/explain` - `GET _cluster/state` - `POST _cluster/reroute` - `GET {index}/_stats` - `GET {index}/_segments` - `GET {index}/_shard_stores` - `GET _cat/[indices,aliases,health,recovery,shards,segments]` Deprecation warnings for accessing system indices take the form: ``` this request accesses system indices: [.some_system_index], but in a future major version, direct access to system indices will be prevented by default ```
1 parent 7620e94 commit 91f4b58

File tree

179 files changed

+2605
-983
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

179 files changed

+2605
-983
lines changed

docs/reference/api-conventions.asciidoc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,14 @@ include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=expand-wildcards]
4242

4343
The defaults settings for the above parameters depend on the API being used.
4444

45+
Some indices (hereafter "system indices") are used by various system
46+
modules and/or plugins to store state or configuration. These indices
47+
are not intended to be accessed directly, and accessing them directly is
48+
deprecated. In the next major version, access to these indices will no longer be
49+
allowed to prevent accidental operations that may cause problems with
50+
Elasticsearch features which depend on the consistency of data in these
51+
indices.
52+
4553
Some multi-target APIs that can target indices also support the following query
4654
string parameter:
4755

docs/reference/docs/delete-by-query.asciidoc

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,13 @@ POST /my-index-000001/_delete_by_query
5353
==== {api-description-title}
5454

5555
You can specify the query criteria in the request URI or the request body
56-
using the same syntax as the <<search-search,Search API>>.
56+
using the same syntax as the <<search-search,Search API>>.
5757

5858
When you submit a delete by query request, {es} gets a snapshot of the data stream or index
5959
when it begins processing the request and deletes matching documents using
6060
`internal` versioning. If a document changes between the time that the
6161
snapshot is taken and the delete operation is processed, it results in a version
62-
conflict and the delete operation fails.
62+
conflict and the delete operation fails.
6363

6464
NOTE: Documents with a version equal to 0 cannot be deleted using delete by
6565
query because `internal` versioning does not support 0 as a valid
@@ -70,18 +70,18 @@ requests sequentially to find all of the matching documents to delete. A bulk
7070
delete request is performed for each batch of matching documents. If a
7171
search or bulk request is rejected, the requests are retried up to 10 times, with
7272
exponential back off. If the maximum retry limit is reached, processing halts
73-
and all failed requests are returned in the response. Any delete requests that
74-
completed successfully still stick, they are not rolled back.
73+
and all failed requests are returned in the response. Any delete requests that
74+
completed successfully still stick, they are not rolled back.
7575

76-
You can opt to count version conflicts instead of halting and returning by
77-
setting `conflicts` to `proceed`.
76+
You can opt to count version conflicts instead of halting and returning by
77+
setting `conflicts` to `proceed`.
7878

7979
===== Refreshing shards
8080

8181
Specifying the `refresh` parameter refreshes all shards involved in the delete
82-
by query once the request completes. This is different than the delete API's
83-
`refresh` parameter, which causes just the shard that received the delete
84-
request to be refreshed. Unlike the delete API, it does not support
82+
by query once the request completes. This is different than the delete API's
83+
`refresh` parameter, which causes just the shard that received the delete
84+
request to be refreshed. Unlike the delete API, it does not support
8585
`wait_for`.
8686

8787
[[docs-delete-by-query-task-api]]
@@ -90,7 +90,7 @@ request to be refreshed. Unlike the delete API, it does not support
9090
If the request contains `wait_for_completion=false`, {es}
9191
performs some preflight checks, launches the request, and returns a
9292
<<tasks,`task`>> you can use to cancel or get the status of the task. {es} creates a
93-
record of this task as a document at `.tasks/task/${taskId}`. When you are
93+
record of this task as a document at `.tasks/task/${taskId}`. When you are
9494
done with a task, you should delete the task document so {es} can reclaim the
9595
space.
9696

@@ -101,20 +101,20 @@ before proceeding with the request. See <<index-wait-for-active-shards>>
101101
for details. `timeout` controls how long each write request waits for unavailable
102102
shards to become available. Both work exactly the way they work in the
103103
<<docs-bulk,Bulk API>>. Delete by query uses scrolled searches, so you can also
104-
specify the `scroll` parameter to control how long it keeps the search context
104+
specify the `scroll` parameter to control how long it keeps the search context
105105
alive, for example `?scroll=10m`. The default is 5 minutes.
106106

107107
===== Throttling delete requests
108108

109109
To control the rate at which delete by query issues batches of delete operations,
110110
you can set `requests_per_second` to any positive decimal number. This pads each
111-
batch with a wait time to throttle the rate. Set `requests_per_second` to `-1`
111+
batch with a wait time to throttle the rate. Set `requests_per_second` to `-1`
112112
to disable throttling.
113113

114-
Throttling uses a wait time between batches so that the internal scroll requests
115-
can be given a timeout that takes the request padding into account. The padding
116-
time is the difference between the batch size divided by the
117-
`requests_per_second` and the time spent writing. By default the batch size is
114+
Throttling uses a wait time between batches so that the internal scroll requests
115+
can be given a timeout that takes the request padding into account. The padding
116+
time is the difference between the batch size divided by the
117+
`requests_per_second` and the time spent writing. By default the batch size is
118118
`1000`, so if `requests_per_second` is set to `500`:
119119

120120
[source,txt]
@@ -123,9 +123,9 @@ target_time = 1000 / 500 per second = 2 seconds
123123
wait_time = target_time - write_time = 2 seconds - .5 seconds = 1.5 seconds
124124
--------------------------------------------------
125125

126-
Since the batch is issued as a single `_bulk` request, large batch sizes
127-
cause {es} to create many requests and wait before starting the next set.
128-
This is "bursty" instead of "smooth".
126+
Since the batch is issued as a single `_bulk` request, large batch sizes
127+
cause {es} to create many requests and wait before starting the next set.
128+
This is "bursty" instead of "smooth".
129129

130130
[[docs-delete-by-query-slice]]
131131
===== Slicing
@@ -134,11 +134,11 @@ Delete by query supports <<slice-scroll, sliced scroll>> to parallelize the
134134
delete process. This can improve efficiency and provide a
135135
convenient way to break the request down into smaller parts.
136136

137-
Setting `slices` to `auto` chooses a reasonable number for most data streams and indices.
138-
If you're slicing manually or otherwise tuning automatic slicing, keep in mind
137+
Setting `slices` to `auto` chooses a reasonable number for most data streams and indices.
138+
If you're slicing manually or otherwise tuning automatic slicing, keep in mind
139139
that:
140140

141-
* Query performance is most efficient when the number of `slices` is equal to
141+
* Query performance is most efficient when the number of `slices` is equal to
142142
the number of shards in the index or backing index. If that number is large (for example,
143143
500), choose a lower number as too many `slices` hurts performance. Setting
144144
`slices` higher than the number of shards generally does not improve efficiency
@@ -171,25 +171,25 @@ Defaults to `true`.
171171
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=analyzer]
172172

173173
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=analyze_wildcard]
174-
174+
175175
`conflicts`::
176-
(Optional, string) What to do if delete by query hits version conflicts:
176+
(Optional, string) What to do if delete by query hits version conflicts:
177177
`abort` or `proceed`. Defaults to `abort`.
178178

179179
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=default_operator]
180180

181181
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=df]
182-
182+
183183
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=expand-wildcards]
184184
+
185185
Defaults to `open`.
186186

187187
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=from]
188188

189189
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=index-ignore-unavailable]
190-
190+
191191
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=lenient]
192-
192+
193193
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=max_docs]
194194

195195
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=preference]
@@ -214,9 +214,9 @@ include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=scroll_size]
214214
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=search_type]
215215

216216
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=search_timeout]
217-
217+
218218
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=slices]
219-
219+
220220
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=sort]
221221

222222
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=source]
@@ -226,7 +226,7 @@ include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=source_excludes]
226226
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=source_includes]
227227

228228
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=stats]
229-
229+
230230
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=terminate_after]
231231

232232
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=timeout]
@@ -239,9 +239,9 @@ include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=wait_for_active_shards
239239
==== {api-request-body-title}
240240

241241
`query`::
242-
(Optional, <<query-dsl,query object>>) Specifies the documents to delete
242+
(Optional, <<query-dsl,query object>>) Specifies the documents to delete
243243
using the <<query-dsl,Query DSL>>.
244-
244+
245245

246246
[[docs-delete-by-query-api-response-body]]
247247
==== Response body
@@ -345,7 +345,7 @@ this is non-empty then the request aborted because of those failures.
345345
Delete by query is implemented using batches, and any failure causes the entire
346346
process to abort but all failures in the current batch are collected into the
347347
array. You can use the `conflicts` option to prevent reindex from aborting on
348-
version conflicts.
348+
version conflicts.
349349

350350
[[docs-delete-by-query-api-example]]
351351
==== {api-examples-title}
@@ -377,7 +377,7 @@ POST /my-index-000001,my-index-000002/_delete_by_query
377377
// TEST[s/^/PUT my-index-000001\nPUT my-index-000002\n/]
378378

379379
Limit the delete by query operation to shards that a particular routing
380-
value:
380+
value:
381381

382382
[source,console]
383383
--------------------------------------------------
@@ -571,7 +571,7 @@ though these are all taken at approximately the same time.
571571

572572
The value of `requests_per_second` can be changed on a running delete by query
573573
using the `_rethrottle` API. Rethrottling that speeds up the
574-
query takes effect immediately but rethrotting that slows down the query
574+
query takes effect immediately but rethrotting that slows down the query
575575
takes effect after completing the current batch to prevent scroll
576576
timeouts.
577577

@@ -670,6 +670,6 @@ POST _tasks/r1A2WoRbTwKZ516z6NEs5A:36619/_cancel
670670

671671
The task ID can be found using the <<tasks,tasks API>>.
672672

673-
Cancellation should happen quickly but might take a few seconds. The task status
674-
API above will continue to list the delete by query task until this task checks that it
673+
Cancellation should happen quickly but might take a few seconds. The task status
674+
API above will continue to list the delete by query task until this task checks that it
675675
has been cancelled and terminates itself.

0 commit comments

Comments
 (0)