Skip to content

Commit e8773f3

Browse files
committed
Updated resolve/cluster end user docs with information about the timeout flag and no index expression endpoint (#121199)
1 parent 38f5207 commit e8773f3

File tree

1 file changed

+50
-8
lines changed

1 file changed

+50
-8
lines changed

docs/reference/indices/resolve-cluster.asciidoc

Lines changed: 50 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ For the most up-to-date API details, refer to {api-es}/group/endpoint-indices[In
1111
--
1212

1313
Resolves the specified index expressions to return information about
14-
each cluster, including the local "querying" cluster, if included.
14+
each cluster, including the local "querying" cluster, if included. If no index expression
15+
is provided, this endpoint will return information about all the remote
16+
clusters that are configured on the querying cluster.
1517

1618
This endpoint is useful before doing a <<modules-cross-cluster-search,{ccs}>> in
1719
order to determine which remote clusters should be included in a search.
@@ -27,7 +29,7 @@ For each cluster in scope, information is returned about:
2729
contact the remote clusters, unlike the <<cluster-remote-info,remote/info>> endpoint.
2830
2. whether each remote cluster is configured with `skip_unavailable` as `true` or `false`
2931
3. whether there are any indices, aliases or data streams on that cluster that match
30-
the index expression
32+
the index expression (if one provided)
3133
4. whether the search is likely to have errors returned when you do a {ccs} (including any
3234
authorization errors if your user does not have permission to query a remote cluster or
3335
the indices on that cluster)
@@ -42,6 +44,12 @@ Once the proper security permissions are obtained, then you can rely on the `con
4244
in the response to determine whether the remote cluster is available and ready for querying.
4345
====
4446

47+
NOTE: The ability to query without an index expression was added in 8.18, so when
48+
querying remote clusters older than that, the local cluster will send the index
49+
expression `dummy*` to those remote clusters. Thus, if an errors occur, you may see a reference
50+
to that index expression even though you didn't request it. If it causes a problem, you can
51+
instead include an index expression like `*:*` to bypass the issue.
52+
4553
////
4654
[source,console]
4755
--------------------------------
@@ -71,6 +79,15 @@ PUT _cluster/settings
7179
// TEST[s/35.238.149.\d+:930\d+/\${transport_host}/]
7280
////
7381

82+
[source,console]
83+
----
84+
GET /_resolve/cluster
85+
----
86+
// TEST[continued]
87+
88+
Returns information about all remote clusters configured on the local cluster
89+
without doing any index matching.
90+
7491
[source,console]
7592
----
7693
GET /_resolve/cluster/my-index-*,cluster*:my-index-*
@@ -108,6 +125,15 @@ Resources on <<remote-clusters,remote clusters>> can be specified using the
108125
[[resolve-cluster-api-query-params]]
109126
==== {api-query-parms-title}
110127

128+
`timeout`::
129+
(Optional, TimeValue) Specify a max wait time for remote clusters to respond.
130+
If a remote cluster does not respond within this timeout period, the API response
131+
will show the cluster as not connected and include an error message that the
132+
request timed out. The default timeout is unset and the query can take
133+
as long as the networking layer is configured to wait for remote clusters that are
134+
not responding (typically 30 seconds).
135+
+
136+
111137
include::{es-ref-dir}/rest-api/common-parms.asciidoc[tag=expand-wildcards]
112138
+
113139
Defaults to `open`.
@@ -126,6 +152,13 @@ ignored when frozen. Defaults to `false`.
126152
+
127153
deprecated:[7.16.0]
128154

155+
[TIP]
156+
====
157+
The index options above are only allowed when specifying an index expression.
158+
You will get an error if you specify index options to the _resolve/cluster API
159+
that takes no index expression.
160+
====
161+
129162

130163
[discrete]
131164
[[usecases-for-resolve-cluster]]
@@ -137,8 +170,8 @@ necessarily reflect whether the remote cluster is available or not. The remote c
137170
be available, while the local cluster is not currently connected to it.
138171

139172
You can use the resolve-cluster API to attempt to reconnect to remote clusters
140-
(for example with `GET _resolve/cluster/*:*`) and
141-
the `connected` field in the response will indicate whether it was successful or not.
173+
(for example with `GET _resolve/cluster` or `GET _resolve/cluster/*:*` ).
174+
The `connected` field in the response will indicate whether it was successful.
142175
If a connection was (re-)established, this will also cause the
143176
<<cluster-remote-info,remote/info>> endpoint to now indicate a connected status.
144177

@@ -231,11 +264,12 @@ The API returns the following response:
231264
==== Identifying potential problems with your {ccs}
232265

233266
The following request shows several examples of how modifying your query can
234-
prevent search failures.
267+
prevent search failures. Note also that a `timeout` of 5 seconds is sent, which
268+
sets the maximum time the query will wait for remote clusters to respond.
235269

236270
[source,console]
237271
--------------------------------------------------
238-
GET /_resolve/cluster/not-present,clust*:my-index*,oldcluster:*?ignore_unavailable=false
272+
GET /_resolve/cluster/not-present,clust*:my-index*,oldcluster:*?ignore_unavailable=false&timeout=5s
239273
--------------------------------------------------
240274
// TEST[continued]
241275
// TEST[s/,oldcluster:*//]
@@ -263,7 +297,12 @@ GET /_resolve/cluster/not-present,clust*:my-index*,oldcluster:*?ignore_unavailab
263297
"connected": false, <3>
264298
"skip_unavailable": false
265299
},
266-
"oldcluster": { <4>
300+
"cluster_three": {
301+
"connected": false,
302+
"skip_unavailable": false,
303+
"error": "Request timed out before receiving a response from the remote cluster" <4>
304+
},
305+
"oldcluster": { <5>
267306
"connected": true,
268307
"skip_unavailable": false,
269308
"matching_indices": true
@@ -285,7 +324,10 @@ could be closed. (You can check this by using the
285324
failed). Since this cluster is marked as `skip_unavailable=false`, you should
286325
probably exclude this cluster from the search by adding `-cluster_two:*` to the
287326
search index expression.
288-
<4> The `oldcluster` remote cluster shows that it has matching indices, but no
327+
<4> For `cluster_three`, the error message indicates that this remote cluster did
328+
not respond within the 5-second timeout window specified, so it is also marked as
329+
not connected.
330+
<5> The `oldcluster` remote cluster shows that it has matching indices, but no
289331
version information is included. This indicates that the cluster version predates
290332
the introduction of the `_resolve/cluster` API in 8.13.0., so you may want to
291333
exclude it from your {ccs}. (Note: the endpoint was able to tell there were

0 commit comments

Comments
 (0)