@@ -249,9 +249,7 @@ public void testRelocationWhileIndexingRandom() throws Exception {
249249 numberOfNodes
250250 );
251251
252- // Start node with PAUSE_INDEXING_ON_THROTTLE setting set to true. This means that if we activate
253- // index throttling for a shard on this node, it will pause indexing for that shard until throttling
254- // is deactivated.
252+ // Randomly use pause throttling vs lock throttling, to verify that relocations proceed regardless
255253 String [] nodes = new String [numberOfNodes ];
256254 logger .info ("--> starting [node1] ..." );
257255 nodes [0 ] = internalCluster ().startNode (
@@ -318,13 +316,15 @@ public void testRelocationWhileIndexingRandom() throws Exception {
318316 logger .info ("--> DONE relocate the shard from {} to {}" , fromNode , toNode );
319317 if (throttleIndexing ) {
320318 // Deactivate throttling on source shard to allow indexing threads to pass
319+ Engine engine = shard .getEngineOrNull ();
320+ assertThat (engine , equalTo (null ));
321321 shard .deactivateThrottling ();
322322 // Activate throttling on target shard before next relocation
323323 indicesService = internalCluster ().getInstance (IndicesService .class , nodes [toNode ]);
324324 shard = indicesService .indexServiceSafe (resolveIndex ("test" )).getShard (0 );
325325 shard .activateThrottling ();
326326 // Verify that indexing is throttled for this shard
327- Engine engine = shard .getEngineOrNull ();
327+ engine = shard .getEngineOrNull ();
328328 assertThat (engine != null && engine .isThrottled (), equalTo (true ));
329329 }
330330 }
0 commit comments