Skip to content

Commit

Permalink
Clarify the behavior of remote/info and resolve/cluster for connected…
Browse files Browse the repository at this point in the history
… status of remotes
  • Loading branch information
quux00 committed Dec 18, 2024
1 parent dadf875 commit 85b0b03
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 5 deletions.
14 changes: 13 additions & 1 deletion docs/reference/cluster/remote-info.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@ The cluster remote info API allows you to retrieve all of the configured
remote cluster information. It returns connection and endpoint information keyed
by the configured remote cluster alias.

TIP: This endpoint returns the information that reflects state on the cluster
you are querying. The `connected` field reports whether the querying cluster is
currently connected to the remote cluster. It does not necessarily reflect whether
the remote cluster is down or unavailable, only whether there is currently an open
connection to it. Elasticsearch does not spontaneously try to reconnect to a
disconnected remote cluster. To trigger a reconnection, attempt a
<<modules-cross-cluster-search,{ccs}>>, <<esql-cross-clusters,{esql} {ccs}>>,
or try the <<indices-resolve-cluster-api,resolve cluster>> endpoint.


[[cluster-remote-info-api-response-body]]
==== {api-response-body-title}
Expand All @@ -34,7 +43,10 @@ by the configured remote cluster alias.
`proxy`.

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

`initial_connect_timeout`::
The initial connect timeout for remote cluster connections.
Expand Down
21 changes: 17 additions & 4 deletions docs/reference/indices/resolve-cluster.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ with this endpoint.

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

1. whether the querying ("local") cluster is currently connected to each remote cluster
in the index expression scope
1. whether the querying ("local") cluster was able to connect to each remote cluster
specified in the index expression. Note that this endpoint actively attempts to
contact the remote clusters, unlike the <<cluster-remote-info,remote/info>> endpoint.
2. whether each remote cluster is configured with `skip_unavailable` as `true` or `false`
3. whether there are any indices, aliases or data streams on that cluster that match
the index expression
Expand Down Expand Up @@ -110,8 +111,21 @@ ignored when frozen. Defaults to `false`.
deprecated:[7.16.0]


[discrete]
[[usecases-for-resolve-cluster]]

=== Test availability of remote clusters

The <<cluster-remote-info,remote/info>> endpoint is commonly used to test whether the "local"
cluster (the cluster being queried) is connected to its remote clusters, but it does not
necessarily reflect whether the remote cluster is available or not. The remote cluster may
be available, while the local cluster is not currently connected to it.

You can use this API to force a reconnection (for example with `GET _resolve/cluster/*:*`) and
examine the `connected` field in the response for each remote. This will also cause the
<<cluster-remote-info,remote/info>> endpoint to now reflect the fact that a connection has
been (re-)established.


=== Advantages of using this endpoint before a {ccs}

You may want to exclude a cluster or index from a search when:
Expand Down Expand Up @@ -195,7 +209,6 @@ The API returns the following response:
<5> The Elasticsearch server version.


[discrete]
[[resolve-cluster-api-error-example]]
==== Identifying potential problems with your {ccs}

Expand Down

0 comments on commit 85b0b03

Please sign in to comment.