Skip to content

Commit

Permalink
add extra ensureGreen()
Browse files Browse the repository at this point in the history
  • Loading branch information
s1monw committed Jun 7, 2016
1 parent c4061fb commit c7f7cdb
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,10 @@ public void testCreateShrinkIndexToN() {
assertTrue("at least 2 nodes but was: " + dataNodes.size(), dataNodes.size() >= 2);
DiscoveryNode[] discoveryNodes = dataNodes.values().toArray(DiscoveryNode.class);
String mergeNode = discoveryNodes[0].getName();
// ensure all shards are allocated otherwise the ensure green below might not succeed since we require the merge node
// if we change the setting too quickly we will end up with one replica unassigned which can't be assigned anymore due
// to the require._name below.
ensureGreen();
// relocate all shards to one node such that we can merge it.
client().admin().indices().prepareUpdateSettings("source")
.setSettings(Settings.builder()
Expand Down

0 comments on commit c7f7cdb

Please sign in to comment.