OpenSearch/docs/reference/ccr/apis/auto-follow/resume-auto-follow-pattern.asciidoc
Yannick Welsch af887be3e5 Hide orphaned tasks from follower stats (#48901)
CCR follower stats can return information for persistent tasks that are in the process of being cleaned up. This is problematic for tests where CCR follower indices have been deleted, but their persistent follower task is only cleaned up asynchronously afterwards. If one of the following tests then accesses the follower stats, it might still get the stats for that follower task.

In addition, some tests were not cleaning up their auto-follow patterns, leaving orphaned patterns behind. Other tests cleaned up their auto-follow patterns. As always the same name was used, it just depended on the test execution order whether this led to a failure or not. This commit fixes the offensive tests, and will also automatically remove auto-follow-patterns at the end of tests, like we do for many other features.

Closes #48700
2019-11-08 13:56:53 +01:00

90 lines
2.6 KiB
Plaintext

[role="xpack"]
[testenv="platinum"]
[[ccr-resume-auto-follow-pattern]]
=== Resume auto-follow pattern API
++++
<titleabbrev>Resume auto-follow pattern</titleabbrev>
++++
Resumes an auto-follow pattern.
[[ccr-resume-auto-follow-pattern-request]]
==== {api-request-title}
`POST /_ccr/auto_follow/<auto_follow_pattern_name>/resume`
[[ccr-resume-auto-follow-pattern-prereqs]]
==== {api-prereq-title}
* If the {es} {security-features} are enabled, you must have `manage_ccr` cluster
privileges on the cluster that contains the follower index. For more information,
see <<security-privileges>>.
[[ccr-resume-auto-follow-pattern-desc]]
==== {api-description-title}
This API resumes an <<ccr-auto-follow,auto-follow pattern>> that has been paused with the
<<ccr-pause-auto-follow-pattern, pause auto-follow pattern API>>. When this API
returns, the auto-follow pattern will resume configuring following indices for
newly created indices on the remote cluster that match its patterns. Remote
indices created while the pattern was paused will also be followed, unless they
have been deleted or closed in the meantime.
[[ccr-resume-auto-follow-pattern-path-parms]]
==== {api-path-parms-title}
`<auto_follow_pattern_name>`::
(Required, string) Specifies the name of the auto-follow pattern to resume.
[[ccr-resume-auto-follow-pattern-examples]]
==== {api-examples-title}
This example resumes the activity of a paused auto-follow pattern
named `my_auto_follow_pattern`:
//////////////////////////
[source,console]
--------------------------------------------------
PUT /_ccr/auto_follow/my_auto_follow_pattern
{
"remote_cluster" : "remote_cluster",
"leader_index_patterns" :
[
"leader_index"
],
"follow_index_pattern" : "{{leader_index}}-follower"
}
--------------------------------------------------
// TEST[setup:remote_cluster]
// TESTSETUP
[source,console]
--------------------------------------------------
DELETE /_ccr/auto_follow/my_auto_follow_pattern
--------------------------------------------------
// TEST
// TEARDOWN
[source,console]
--------------------------------------------------
POST /_ccr/auto_follow/my_auto_follow_pattern/pause
--------------------------------------------------
// TEST
//////////////////////////
[source,console]
--------------------------------------------------
POST /_ccr/auto_follow/my_auto_follow_pattern/resume
--------------------------------------------------
// TEST
The API returns the following result:
[source,console-result]
--------------------------------------------------
{
"acknowledged" : true
}
--------------------------------------------------