post-forget-follower.asciidoc 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. [role="xpack"]
  2. [testenv="platinum"]
  3. [[ccr-post-forget-follower]]
  4. === Forget follower API
  5. ++++
  6. <titleabbrev>Forget follower</titleabbrev>
  7. ++++
  8. Removes the follower retention leases from the leader.
  9. [[ccr-post-forget-follower-request]]
  10. ==== {api-request-title}
  11. //////////////////////////
  12. [source,js]
  13. --------------------------------------------------
  14. PUT /follower_index/_ccr/follow?wait_for_active_shards=1
  15. {
  16. "remote_cluster" : "remote_cluster",
  17. "leader_index" : "leader_index"
  18. }
  19. --------------------------------------------------
  20. // CONSOLE
  21. // TESTSETUP
  22. // TEST[setup:remote_cluster_and_leader_index]
  23. [source,js]
  24. --------------------------------------------------
  25. POST /follower_index/_ccr/pause_follow
  26. --------------------------------------------------
  27. // CONSOLE
  28. // TEARDOWN
  29. //////////////////////////
  30. [source,js]
  31. --------------------------------------------------
  32. POST /<leader_index>/_ccr/forget_follower
  33. {
  34. "follower_cluster" : "<follower_cluster>",
  35. "follower_index" : "<follower_index>",
  36. "follower_index_uuid" : "<follower_index_uuid>",
  37. "leader_remote_cluster" : "<leader_remote_cluster>"
  38. }
  39. --------------------------------------------------
  40. // CONSOLE
  41. // TEST[s/<leader_index>/leader_index/]
  42. // TEST[s/<follower_cluster>/follower_cluster/]
  43. // TEST[s/<follower_index>/follower_index/]
  44. // TEST[s/<follower_index_uuid>/follower_index_uuid/]
  45. // TEST[s/<leader_remote_cluster>/leader_remote_cluster/]
  46. // TEST[skip_shard_failures]
  47. [source,js]
  48. --------------------------------------------------
  49. {
  50. "_shards" : {
  51. "total" : 1,
  52. "successful" : 1,
  53. "failed" : 0,
  54. "failures" : [ ]
  55. }
  56. }
  57. --------------------------------------------------
  58. // TESTRESPONSE[s/"total" : 1/"total" : $body._shards.total/]
  59. // TESTRESPONSE[s/"successful" : 1/"successful" : $body._shards.successful/]
  60. // TESTRESPONSE[s/"failed" : 0/"failed" : $body._shards.failed/]
  61. // TESTRESPONSE[s/"failures" : \[ \]/"failures" : $body._shards.failures/]
  62. [[ccr-post-forget-follower-prereqs]]
  63. ==== {api-prereq-title}
  64. * If the {es} {security-features} are enabled, you must have `manage_leader_index`
  65. index privileges for the leader index. For more information, see
  66. {stack-ov}/security-privileges.html[Security privileges].
  67. [[ccr-post-forget-follower-desc]]
  68. ==== {api-description-title}
  69. A following index takes out retention leases on its leader index. These
  70. retention leases are used to increase the likelihood that the shards of the
  71. leader index retain the history of operations that the shards of the following
  72. index need to execute replication. When a follower index is converted to a
  73. regular index via the <<ccr-post-unfollow,unfollow API>> (either via explicit
  74. execution of this API, or implicitly via {ilm}), these retention leases are
  75. removed. However, removing these retention leases can fail (e.g., if the remote
  76. cluster containing the leader index is unavailable). While these retention
  77. leases will eventually expire on their own, their extended existence can cause
  78. the leader index to hold more history than necessary, and prevent {ilm} from
  79. performing some operations on the leader index. This API exists to enable
  80. manually removing these retention leases when the unfollow API was unable to do
  81. so.
  82. NOTE: This API does not stop replication by a following index. If you use this
  83. API targeting a follower index that is still actively following, the following
  84. index will add back retention leases on the leader. The only purpose of this API
  85. is to handle the case of failure to remove the following retention leases after
  86. the <<ccr-post-unfollow,unfollow API>> is invoked.
  87. [[ccr-post-forget-follower-path-parms]]
  88. ==== {api-path-parms-title}
  89. `<leader_index>` (Required)::
  90. (string) the name of the leader index
  91. [[ccr-post-forget-follower-request-body]]
  92. ==== {api-request-body-title}
  93. `follower_cluster` (Required)::
  94. (string) The name of the cluster containing the follower index.
  95. `follower_index` (Required)::
  96. (string) The name of the follower index.
  97. `follower_index_uuid` (Required)::
  98. (string) The UUID of the follower index.
  99. `leader_remote_cluster` (Required)::
  100. (string) The alias (from the perspective of the cluster containing the
  101. follower index) of the <<modules-remote-clusters,remote cluster>> containing
  102. the leader index.
  103. [[ccr-post-forget-follower-examples]]
  104. ==== {api-examples-title}
  105. This example removes the follower retention leases for `follower_index` from
  106. `leader_index`.
  107. [source,js]
  108. --------------------------------------------------
  109. POST /leader_index/_ccr/forget_follower
  110. {
  111. "follower_cluster" : "follower_cluster",
  112. "follower_index" : "follower_index",
  113. "follower_index_uuid" : "vYpnaWPRQB6mNspmoCeYyA",
  114. "leader_remote_cluster" : "leader_cluster"
  115. }
  116. --------------------------------------------------
  117. // CONSOLE
  118. // TEST[skip_shard_failures]
  119. The API returns the following result:
  120. [source,js]
  121. --------------------------------------------------
  122. {
  123. "_shards" : {
  124. "total" : 1,
  125. "successful" : 1,
  126. "failed" : 0,
  127. "failures" : [ ]
  128. }
  129. }
  130. --------------------------------------------------
  131. // TESTRESPONSE[s/"total" : 1/"total" : $body._shards.total/]
  132. // TESTRESPONSE[s/"successful" : 1/"successful" : $body._shards.successful/]
  133. // TESTRESPONSE[s/"failed" : 0/"failed" : $body._shards.failed/]
  134. // TESTRESPONSE[s/"failures" : \[ \]/"failures" : $body._shards.failures/]