From 732a723aaf7554f5580907b8a5b1a6fdf61c47b7 Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Mon, 1 Apr 2019 13:08:12 +0200 Subject: [PATCH] Use `wait_for_active_shards` in put follow api call when upgrading from 6.7.0 or higher. Closes #40677 --- .../org/elasticsearch/upgrades/CcrRollingUpgradeIT.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/x-pack/qa/rolling-upgrade-multi-cluster/src/test/java/org/elasticsearch/upgrades/CcrRollingUpgradeIT.java b/x-pack/qa/rolling-upgrade-multi-cluster/src/test/java/org/elasticsearch/upgrades/CcrRollingUpgradeIT.java index 78c8c49885d48..57b7b1032521e 100644 --- a/x-pack/qa/rolling-upgrade-multi-cluster/src/test/java/org/elasticsearch/upgrades/CcrRollingUpgradeIT.java +++ b/x-pack/qa/rolling-upgrade-multi-cluster/src/test/java/org/elasticsearch/upgrades/CcrRollingUpgradeIT.java @@ -309,7 +309,11 @@ private static void createIndex(RestClient client, String name, Settings setting } private static void followIndex(RestClient client, String leaderCluster, String leaderIndex, String followIndex) throws IOException { - final Request request = new Request("PUT", "/" + followIndex + "/_ccr/follow"); + String endpoint = "/" + followIndex + "/_ccr/follow"; + if (UPGRADE_FROM_VERSION.onOrAfter(Version.V_6_7_0)) { + endpoint += "?wait_for_active_shards=1"; + } + final Request request = new Request("PUT", endpoint); request.setJsonEntity("{\"remote_cluster\": \"" + leaderCluster + "\", \"leader_index\": \"" + leaderIndex + "\", \"read_poll_timeout\": \"10ms\"}"); assertOK(client.performRequest(request));