Use CcrRepository to init follower index#35719
Merged
Tim-Brooks merged 108 commits intoelastic:masterfrom Jan 29, 2019
Merged
Conversation
ywelsch
reviewed
Jan 28, 2019
...ck/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/action/TransportPutFollowAction.java
Outdated
Show resolved
Hide resolved
...ck/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/action/TransportPutFollowAction.java
Outdated
Show resolved
Hide resolved
...ck/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/action/TransportPutFollowAction.java
Outdated
Show resolved
Hide resolved
| imdBuilder.setRoutingNumShards(leaderIndexMetaData.getRoutingNumShards()); | ||
| // We assert that insync allocation ids are not empty in `PrimaryShardAllocator` | ||
| for (IntObjectCursor<Set<String>> entry : leaderIndexMetaData.getInSyncAllocationIds()) { | ||
| imdBuilder.putInSyncAllocationIds(entry.key, entry.value); |
Contributor
There was a problem hiding this comment.
we could just put a dummy value in here
Contributor
Author
There was a problem hiding this comment.
I used UUIDS in the change.
x-pack/plugin/src/test/resources/rest-api-spec/api/ccr.follow.json
Outdated
Show resolved
Hide resolved
Contributor
Author
|
@elasticmachine run elasticsearch-ci/2 |
ywelsch
approved these changes
Jan 29, 2019
| ActionListener<PutFollowAction.Response> originalListener, | ||
| RestoreService.RestoreCompletionResponse response) { | ||
| final ActionListener<PutFollowAction.Response> listener; | ||
| if (request.waitForActiveShards() == ActiveShardCount.NONE) { |
Contributor
There was a problem hiding this comment.
let's use .equals() instead of == (even though it's not strictly needed, it's less bugprone if we were to refactor this in the future)
| imdBuilder.setRoutingNumShards(leaderIndexMetaData.getRoutingNumShards()); | ||
| // We assert that insync allocation ids are not empty in `PrimaryShardAllocator` | ||
| for (IntObjectCursor<Set<String>> entry : leaderIndexMetaData.getInSyncAllocationIds()) { | ||
| imdBuilder.putInSyncAllocationIds(entry.key, Collections.singleton(UUIDs.randomBase64UUID())); |
Contributor
There was a problem hiding this comment.
let's use a special id "ccr_restore" instead (nicer for debugging purposes)
Contributor
Author
|
@elasticmachine run elasticsearch-ci/packaging-sample |
Tim-Brooks
added a commit
to Tim-Brooks/elasticsearch
that referenced
this pull request
Jan 29, 2019
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.
Tim-Brooks
added a commit
that referenced
this pull request
Jan 31, 2019
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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit modifies the put follow index action to use a
CcrRepositorywhen creating a follower index. It simplyroutes the logic through the snapshot/restore process. The restored
shards are still empty in this commit.