Use CcrRepository to init follower index (#35719)

This commit modifies the put follow index action to use a
CcrRepository when creating a follower index. It routes 
the logic through the snapshot/restore process. A 
wait_for_active_shards parameter can be used to configure
how long to wait before returning the response.
This commit is contained in:
Tim Brooks 2019-01-29 11:47:29 -07:00 committed by GitHub
parent d05a4b9d14
commit 00ace369af
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
31 changed files with 488 additions and 169 deletions

View file

@ -22,7 +22,7 @@ replication options and whether the follower indices are active or paused.
[source,js]
--------------------------------------------------
PUT /follower_index/_ccr/follow
PUT /follower_index/_ccr/follow?wait_for_active_shards=1
{
"remote_cluster" : "remote_cluster",
"leader_index" : "leader_index"

View file

@ -21,7 +21,7 @@ following tasks associated with each shard for the specified indices.
[source,js]
--------------------------------------------------
PUT /follower_index/_ccr/follow
PUT /follower_index/_ccr/follow?wait_for_active_shards=1
{
"remote_cluster" : "remote_cluster",
"leader_index" : "leader_index"

View file

@ -24,7 +24,7 @@ following task.
[source,js]
--------------------------------------------------
PUT /follower_index/_ccr/follow
PUT /follower_index/_ccr/follow?wait_for_active_shards=1
{
"remote_cluster" : "remote_cluster",
"leader_index" : "leader_index"

View file

@ -23,7 +23,7 @@ returns, the follower index will resume fetching operations from the leader inde
[source,js]
--------------------------------------------------
PUT /follower_index/_ccr/follow
PUT /follower_index/_ccr/follow?wait_for_active_shards=1
{
"remote_cluster" : "remote_cluster",
"leader_index" : "leader_index"

View file

@ -27,7 +27,7 @@ irreversible operation.
[source,js]
--------------------------------------------------
PUT /follower_index/_ccr/follow
PUT /follower_index/_ccr/follow?wait_for_active_shards=1
{
"remote_cluster" : "remote_cluster",
"leader_index" : "leader_index"

View file

@ -31,7 +31,7 @@ POST /follower_index/_ccr/pause_follow
[source,js]
--------------------------------------------------
PUT /<follower_index>/_ccr/follow
PUT /<follower_index>/_ccr/follow?wait_for_active_shards=1
{
"remote_cluster" : "<remote_cluster>",
"leader_index" : "<leader_index>"
@ -43,6 +43,11 @@ PUT /<follower_index>/_ccr/follow
// TEST[s/<remote_cluster>/remote_cluster/]
// TEST[s/<leader_index>/leader_index/]
The `wait_for_active_shards` parameter specifies the number of shards to wait on being active
before responding. This defaults to waiting on none of the shards to be active. A shard must
be restored from the leader index being active. Restoring a follower shard requires transferring
all the remote Lucene segment files to the follower index.
==== Path Parameters
`follower_index` (required)::
@ -73,7 +78,7 @@ This example creates a follower index named `follower_index`:
[source,js]
--------------------------------------------------
PUT /follower_index/_ccr/follow
PUT /follower_index/_ccr/follow?wait_for_active_shards=1
{
"remote_cluster" : "remote_cluster",
"leader_index" : "leader_index",

View file

@ -22,7 +22,7 @@ shard-level stats as in the <<ccr-get-follow-stats,get follower stats API>>.
[source,js]
--------------------------------------------------
PUT /follower_index/_ccr/follow
PUT /follower_index/_ccr/follow?wait_for_active_shards=1
{
"remote_cluster" : "remote_cluster",
"leader_index" : "leader_index"

View file

@ -230,7 +230,7 @@ cluster.
[source,js]
--------------------------------------------------
PUT /server-metrics-copy/_ccr/follow
PUT /server-metrics-copy/_ccr/follow?wait_for_active_shards=1
{
"remote_cluster" : "leader",
"leader_index" : "server-metrics"