Skip to content

Commit 1c48948

Browse files
authored
Clarify the behavior of remote/info and resolve/cluster for connected status of remotes (#118993) (#121203)
1 parent 28a1a4d commit 1c48948

File tree

2 files changed

+35
-17
lines changed

2 files changed

+35
-17
lines changed

docs/reference/cluster/remote-info.asciidoc

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,18 @@ Returns configured remote cluster information.
2626
[[cluster-remote-info-api-desc]]
2727
==== {api-description-title}
2828

29-
The cluster remote info API allows you to retrieve all of the configured
30-
remote cluster information. It returns connection and endpoint information keyed
29+
The cluster remote info API allows you to retrieve information about configured
30+
remote clusters. It returns connection and endpoint information keyed
3131
by the configured remote cluster alias.
3232

33+
TIP: This API returns information that reflects current state on the local cluster.
34+
The `connected` field does not necessarily reflect whether a remote cluster is
35+
down or unavailable, only whether there is currently an open connection to it.
36+
Elasticsearch does not spontaneously try to reconnect to a disconnected remote
37+
cluster. To trigger a reconnection, attempt a <<modules-cross-cluster-search,{ccs}>>,
38+
<<esql-cross-clusters,{esql} {ccs}>>, or try the
39+
<<indices-resolve-cluster-api,resolve cluster>> endpoint.
40+
3341

3442
[[cluster-remote-info-api-response-body]]
3543
==== {api-response-body-title}
@@ -39,7 +47,10 @@ by the configured remote cluster alias.
3947
`proxy`.
4048

4149
`connected`::
42-
True if there is at least one connection to the remote cluster.
50+
True if there is at least one open connection to the remote cluster. When
51+
false, it means that the cluster no longer has an open connection to the
52+
remote cluster. It does not necessarily mean that the remote cluster is
53+
down or unavailable, just that at some point a connection was lost.
4354

4455
`initial_connect_timeout`::
4556
The initial connect timeout for remote cluster connections.

docs/reference/indices/resolve-cluster.asciidoc

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ 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 cluster, if included.
14+
each cluster, including the local "querying" cluster, if included.
1515

1616
This endpoint is useful before doing a <<modules-cross-cluster-search,{ccs}>> in
1717
order to determine which remote clusters should be included in a search.
@@ -22,12 +22,13 @@ with this endpoint.
2222

2323
For each cluster in the index expression, information is returned about:
2424

25-
1. whether the querying ("local") cluster is currently connected to each remote cluster
26-
in the index expression scope
25+
1. whether the querying ("local") cluster was able to connect to each remote cluster
26+
specified in the index expression. Note that this endpoint actively attempts to
27+
contact the remote clusters, unlike the <<cluster-remote-info,remote/info>> endpoint.
2728
2. whether each remote cluster is configured with `skip_unavailable` as `true` or `false`
2829
3. whether there are any indices, aliases or data streams on that cluster that match
2930
the index expression
30-
4. whether the search is likely to have errors returned when you do the {ccs} (including any
31+
4. whether the search is likely to have errors returned when you do a {ccs} (including any
3132
authorization errors if your user does not have permission to query a remote cluster or
3233
the indices on that cluster)
3334
5. (in some cases) cluster version information, including the Elasticsearch server version
@@ -41,7 +42,6 @@ Once the proper security permissions are obtained, then you can rely on the `con
4142
in the response to determine whether the remote cluster is available and ready for querying.
4243
====
4344

44-
4545
////
4646
[source,console]
4747
--------------------------------
@@ -129,11 +129,25 @@ deprecated:[7.16.0]
129129

130130
[discrete]
131131
[[usecases-for-resolve-cluster]]
132+
=== Test availability of remote clusters
133+
134+
The <<cluster-remote-info,remote/info>> endpoint is commonly used to test whether the "local"
135+
cluster (the cluster being queried) is connected to its remote clusters, but it does not
136+
necessarily reflect whether the remote cluster is available or not. The remote cluster may
137+
be available, while the local cluster is not currently connected to it.
138+
139+
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.
142+
If a connection was (re-)established, this will also cause the
143+
<<cluster-remote-info,remote/info>> endpoint to now indicate a connected status.
144+
145+
132146
=== Advantages of using this endpoint before a {ccs}
133147

134148
You may want to exclude a cluster or index from a search when:
135149

136-
1. A remote cluster is not currently connected and is configured with `skip_unavailable`=`false`.
150+
1. A remote cluster could not be connected to and is configured with `skip_unavailable`=`false`.
137151
Executing a {ccs} under those conditions will cause
138152
<<cross-cluster-search-failures,the entire search to fail>>.
139153

@@ -247,14 +261,7 @@ GET /_resolve/cluster/not-present,clust*:my-index*,oldcluster:*?ignore_unavailab
247261
},
248262
"cluster_two": {
249263
"connected": false, <3>
250-
"skip_unavailable": false,
251-
"matching_indices": true,
252-
"version": {
253-
"number": "8.13.0",
254-
"build_flavor": "default",
255-
"minimum_wire_compatibility_version": "7.17.0",
256-
"minimum_index_compatibility_version": "7.0.0"
257-
}
264+
"skip_unavailable": false
258265
},
259266
"oldcluster": { <4>
260267
"connected": true,

0 commit comments

Comments
 (0)