Test: testCancelRecoveryAndResume - add network hook before bumping replicas

This commit is contained in:
Boaz Leskes 2015-03-20 16:24:36 +01:00
parent 7d64877326
commit 0f2d2d0495
1 changed files with 7 additions and 5 deletions

View File

@ -109,11 +109,6 @@ public class TruncatedRecoveryTests extends ElasticsearchIntegrationTest {
client().admin().indices().prepareFlush().setForce(true).setWaitIfOngoing(true).get();
client().admin().indices().prepareOptimize().setMaxNumSegments(1).setFlush(true).get();
logger.info("--> bumping replicas to 1"); //
client().admin().indices().prepareUpdateSettings("test").setSettings(settingsBuilder()
.put(IndexMetaData.SETTING_NUMBER_OF_REPLICAS, 1)
.put("index.routing.allocation.include._name", // now allow allocation on all nodes
primariesNode.getNode().name() + "," + unluckyNode.getNode().name())).get();
final CountDownLatch latch = new CountDownLatch(1);
final AtomicBoolean truncate = new AtomicBoolean(true);
for (NodeStats dataNode : dataNodeStats) {
@ -134,6 +129,13 @@ public class TruncatedRecoveryTests extends ElasticsearchIntegrationTest {
}
});
}
logger.info("--> bumping replicas to 1"); //
client().admin().indices().prepareUpdateSettings("test").setSettings(settingsBuilder()
.put(IndexMetaData.SETTING_NUMBER_OF_REPLICAS, 1)
.put("index.routing.allocation.include._name", // now allow allocation on all nodes
primariesNode.getNode().name() + "," + unluckyNode.getNode().name())).get();
latch.await();
// at this point we got some truncated left overs on the replica on the unlucky node