wait for shard to be allocated before executing a resume follow api
This commit is contained in:
parent
45b17e8645
commit
e8ea85d6e9
|
@ -272,7 +272,9 @@ public class CcrRollingUpgradeIT extends AbstractMultiClusterUpgradeTestCase {
|
|||
index(leaderClient(), "leader_index5", 128);
|
||||
break;
|
||||
case ALL:
|
||||
ensureGreen(followerClient(), "follower_index5");
|
||||
resumeIndexFollowing(followerClient(), "follower_index5");
|
||||
ensureGreen(leaderClient(), "follower_index6");
|
||||
resumeIndexFollowing(leaderClient(), "follower_index6");
|
||||
|
||||
assertTotalHitCount("follower_index5", 896, followerClient());
|
||||
|
@ -374,4 +376,13 @@ public class CcrRollingUpgradeIT extends AbstractMultiClusterUpgradeTestCase {
|
|||
assertOK(client.performRequest(new Request("POST", "/" + followerIndex + "/_ccr/resume_follow")));
|
||||
}
|
||||
|
||||
private static void ensureGreen(RestClient client, String index) throws IOException {
|
||||
Request request = new Request("GET", "/_cluster/health/" + index);
|
||||
request.addParameter("wait_for_status", "green");
|
||||
request.addParameter("wait_for_no_relocating_shards", "true");
|
||||
request.addParameter("timeout", "70s");
|
||||
request.addParameter("level", "shards");
|
||||
client.performRequest(request);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue