2019-03-07 10:29:10 -05:00
|
|
|
[role="xpack"]
|
|
|
|
[testenv="platinum"]
|
|
|
|
[[ccr-post-forget-follower]]
|
2019-07-04 11:22:17 -04:00
|
|
|
=== Forget follower API
|
2019-03-07 10:29:10 -05:00
|
|
|
++++
|
2019-07-04 11:22:17 -04:00
|
|
|
<titleabbrev>Forget follower</titleabbrev>
|
2019-03-07 10:29:10 -05:00
|
|
|
++++
|
|
|
|
|
|
|
|
Removes the follower retention leases from the leader.
|
|
|
|
|
2019-07-04 11:22:17 -04:00
|
|
|
[[ccr-post-forget-follower-request]]
|
|
|
|
==== {api-request-title}
|
2019-03-07 10:29:10 -05:00
|
|
|
|
|
|
|
//////////////////////////
|
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
|
|
|
PUT /follower_index/_ccr/follow?wait_for_active_shards=1
|
|
|
|
{
|
|
|
|
"remote_cluster" : "remote_cluster",
|
|
|
|
"leader_index" : "leader_index"
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|
|
|
|
// CONSOLE
|
|
|
|
// TESTSETUP
|
|
|
|
// TEST[setup:remote_cluster_and_leader_index]
|
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
|
|
|
POST /follower_index/_ccr/pause_follow
|
|
|
|
--------------------------------------------------
|
|
|
|
// CONSOLE
|
|
|
|
// TEARDOWN
|
|
|
|
|
|
|
|
//////////////////////////
|
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
|
|
|
POST /<leader_index>/_ccr/forget_follower
|
|
|
|
{
|
|
|
|
"follower_cluster" : "<follower_cluster>",
|
|
|
|
"follower_index" : "<follower_index>",
|
|
|
|
"follower_index_uuid" : "<follower_index_uuid>",
|
|
|
|
"leader_remote_cluster" : "<leader_remote_cluster>"
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|
|
|
|
// CONSOLE
|
|
|
|
// TEST[s/<leader_index>/leader_index/]
|
|
|
|
// TEST[s/<follower_cluster>/follower_cluster/]
|
|
|
|
// TEST[s/<follower_index>/follower_index/]
|
|
|
|
// TEST[s/<follower_index_uuid>/follower_index_uuid/]
|
|
|
|
// TEST[s/<leader_remote_cluster>/leader_remote_cluster/]
|
|
|
|
// TEST[skip_shard_failures]
|
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
|
|
|
{
|
|
|
|
"_shards" : {
|
|
|
|
"total" : 1,
|
|
|
|
"successful" : 1,
|
|
|
|
"failed" : 0,
|
|
|
|
"failures" : [ ]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|
|
|
|
// TESTRESPONSE[s/"total" : 1/"total" : $body._shards.total/]
|
|
|
|
// TESTRESPONSE[s/"successful" : 1/"successful" : $body._shards.successful/]
|
|
|
|
// TESTRESPONSE[s/"failed" : 0/"failed" : $body._shards.failed/]
|
|
|
|
// TESTRESPONSE[s/"failures" : \[ \]/"failures" : $body._shards.failures/]
|
|
|
|
|
2019-07-04 11:22:17 -04:00
|
|
|
[[ccr-post-forget-follower-prereqs]]
|
|
|
|
==== {api-prereq-title}
|
2019-03-07 10:29:10 -05:00
|
|
|
|
2019-07-04 11:22:17 -04:00
|
|
|
* If the {es} {security-features} are enabled, you must have `manage_leader_index`
|
|
|
|
index privileges for the leader index. For more information, see
|
|
|
|
{stack-ov}/security-privileges.html[Security privileges].
|
2019-03-07 10:29:10 -05:00
|
|
|
|
2019-07-04 11:22:17 -04:00
|
|
|
[[ccr-post-forget-follower-desc]]
|
|
|
|
==== {api-description-title}
|
2019-03-07 10:29:10 -05:00
|
|
|
|
2019-07-04 11:22:17 -04:00
|
|
|
A following index takes out retention leases on its leader index. These
|
|
|
|
retention leases are used to increase the likelihood that the shards of the
|
|
|
|
leader index retain the history of operations that the shards of the following
|
|
|
|
index need to execute replication. When a follower index is converted to a
|
|
|
|
regular index via the <<ccr-post-unfollow,unfollow API>> (either via explicit
|
|
|
|
execution of this API, or implicitly via {ilm}), these retention leases are
|
|
|
|
removed. However, removing these retention leases can fail (e.g., if the remote
|
|
|
|
cluster containing the leader index is unavailable). While these retention
|
|
|
|
leases will eventually expire on their own, their extended existence can cause
|
|
|
|
the leader index to hold more history than necessary, and prevent {ilm} from
|
|
|
|
performing some operations on the leader index. This API exists to enable
|
|
|
|
manually removing these retention leases when the unfollow API was unable to do
|
|
|
|
so.
|
2019-03-07 10:29:10 -05:00
|
|
|
|
2019-07-04 11:22:17 -04:00
|
|
|
NOTE: This API does not stop replication by a following index. If you use this
|
|
|
|
API targeting a follower index that is still actively following, the following
|
|
|
|
index will add back retention leases on the leader. The only purpose of this API
|
|
|
|
is to handle the case of failure to remove the following retention leases after
|
|
|
|
the <<ccr-post-unfollow,unfollow API>> is invoked.
|
2019-03-07 10:29:10 -05:00
|
|
|
|
2019-07-04 11:22:17 -04:00
|
|
|
[[ccr-post-forget-follower-path-parms]]
|
|
|
|
==== {api-path-parms-title}
|
2019-03-07 10:29:10 -05:00
|
|
|
|
2019-07-12 11:26:31 -04:00
|
|
|
`<leader_index>`::
|
|
|
|
(Required, string) The name of the leader index.
|
2019-03-07 10:29:10 -05:00
|
|
|
|
2019-07-04 11:22:17 -04:00
|
|
|
[[ccr-post-forget-follower-request-body]]
|
|
|
|
==== {api-request-body-title}
|
|
|
|
|
2019-07-12 11:26:31 -04:00
|
|
|
`follower_cluster`::
|
|
|
|
(Required, string) The name of the cluster containing the follower index.
|
2019-07-04 11:22:17 -04:00
|
|
|
|
2019-07-12 11:26:31 -04:00
|
|
|
`follower_index`::
|
|
|
|
(Required, string) The name of the follower index.
|
2019-07-04 11:22:17 -04:00
|
|
|
|
2019-07-12 11:26:31 -04:00
|
|
|
`follower_index_uuid`::
|
|
|
|
(Required, string) The UUID of the follower index.
|
2019-07-04 11:22:17 -04:00
|
|
|
|
2019-07-12 11:26:31 -04:00
|
|
|
`leader_remote_cluster`::
|
|
|
|
(Required, string) The alias (from the perspective of the cluster containing
|
|
|
|
the follower index) of the <<modules-remote-clusters,remote cluster>>
|
|
|
|
containing the leader index.
|
2019-03-07 10:29:10 -05:00
|
|
|
|
2019-07-04 11:22:17 -04:00
|
|
|
[[ccr-post-forget-follower-examples]]
|
|
|
|
==== {api-examples-title}
|
2019-03-07 10:29:10 -05:00
|
|
|
|
|
|
|
This example removes the follower retention leases for `follower_index` from
|
|
|
|
`leader_index`.
|
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
|
|
|
POST /leader_index/_ccr/forget_follower
|
|
|
|
{
|
2019-03-13 10:02:17 -04:00
|
|
|
"follower_cluster" : "follower_cluster",
|
2019-03-07 10:29:10 -05:00
|
|
|
"follower_index" : "follower_index",
|
2019-03-13 10:02:17 -04:00
|
|
|
"follower_index_uuid" : "vYpnaWPRQB6mNspmoCeYyA",
|
|
|
|
"leader_remote_cluster" : "leader_cluster"
|
2019-03-07 10:29:10 -05:00
|
|
|
}
|
|
|
|
--------------------------------------------------
|
|
|
|
// CONSOLE
|
|
|
|
// TEST[skip_shard_failures]
|
|
|
|
|
|
|
|
The API returns the following result:
|
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
|
|
|
{
|
|
|
|
"_shards" : {
|
|
|
|
"total" : 1,
|
|
|
|
"successful" : 1,
|
|
|
|
"failed" : 0,
|
|
|
|
"failures" : [ ]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|
|
|
|
// TESTRESPONSE[s/"total" : 1/"total" : $body._shards.total/]
|
|
|
|
// TESTRESPONSE[s/"successful" : 1/"successful" : $body._shards.successful/]
|
|
|
|
// TESTRESPONSE[s/"failed" : 0/"failed" : $body._shards.failed/]
|
|
|
|
// TESTRESPONSE[s/"failures" : \[ \]/"failures" : $body._shards.failures/]
|