Skip to content

Commit

Permalink
ensure no initializing shards during cluster cleanup (#39283) (#39480)
Browse files Browse the repository at this point in the history
there are testing situations where newly created indices
are being wiped before they are fully initialized. This results
in an edge-case in the shard-locking strategy where an index
cannot be deleted.

This should fix that
  • Loading branch information
talevy authored Feb 27, 2019
1 parent 8b26f59 commit f538b30
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ protected HttpHost buildHttpHost(String host, int port) {
@After
public final void cleanUpCluster() throws Exception {
if (preserveClusterUponCompletion() == false) {
ensureNoInitializingShards();
wipeCluster();
waitForClusterStateUpdatesToFinish();
logIfThereAreRunningTasks();
Expand Down Expand Up @@ -806,7 +807,7 @@ protected static void ensureNoInitializingShards() throws IOException {
request.addParameter("wait_for_no_initializing_shards", "true");
request.addParameter("timeout", "70s");
request.addParameter("level", "shards");
client().performRequest(request);
adminClient().performRequest(request);
}

protected static void createIndex(String name, Settings settings) throws IOException {
Expand Down

0 comments on commit f538b30

Please sign in to comment.