post-forget-follower.asciidoc 5.1 KB

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