@@ -284,14 +284,14 @@ public void testClosesPreventsNewOperations() throws InterruptedException, Execu
284
284
closeShards (indexShard );
285
285
assertThat (indexShard .getActiveOperationsCount (), equalTo (0 ));
286
286
try {
287
- indexShard .acquirePrimaryOperationPermit (null , ThreadPool .Names .INDEX , "" );
287
+ indexShard .acquirePrimaryOperationPermit (null , ThreadPool .Names .BULK , "" );
288
288
fail ("we should not be able to increment anymore" );
289
289
} catch (IndexShardClosedException e ) {
290
290
// expected
291
291
}
292
292
try {
293
293
indexShard .acquireReplicaOperationPermit (indexShard .getPrimaryTerm (), SequenceNumbers .UNASSIGNED_SEQ_NO , null ,
294
- ThreadPool .Names .INDEX , "" );
294
+ ThreadPool .Names .BULK , "" );
295
295
fail ("we should not be able to increment anymore" );
296
296
} catch (IndexShardClosedException e ) {
297
297
// expected
@@ -302,7 +302,7 @@ public void testRejectOperationPermitWithHigherTermWhenNotStarted() throws IOExc
302
302
IndexShard indexShard = newShard (false );
303
303
expectThrows (IndexShardNotStartedException .class , () ->
304
304
indexShard .acquireReplicaOperationPermit (indexShard .getPrimaryTerm () + randomIntBetween (1 , 100 ),
305
- SequenceNumbers .UNASSIGNED_SEQ_NO , null , ThreadPool .Names .INDEX , "" ));
305
+ SequenceNumbers .UNASSIGNED_SEQ_NO , null , ThreadPool .Names .BULK , "" ));
306
306
closeShards (indexShard );
307
307
}
308
308
@@ -342,7 +342,7 @@ public void onFailure(Exception e) {
342
342
throw new RuntimeException (e );
343
343
}
344
344
},
345
- ThreadPool .Names .INDEX , id );
345
+ ThreadPool .Names .BULK , id );
346
346
});
347
347
thread .start ();
348
348
threads .add (thread );
@@ -393,7 +393,7 @@ public void onFailure(Exception e) {
393
393
throw new RuntimeException (e );
394
394
}
395
395
},
396
- ThreadPool .Names .INDEX , id );
396
+ ThreadPool .Names .BULK , id );
397
397
});
398
398
thread .start ();
399
399
delayedThreads .add (thread );
@@ -589,7 +589,7 @@ public void testOperationPermitsOnPrimaryShards() throws InterruptedException, E
589
589
assertEquals (0 , indexShard .getActiveOperationsCount ());
590
590
if (indexShard .routingEntry ().isRelocationTarget () == false ) {
591
591
try {
592
- indexShard .acquireReplicaOperationPermit (primaryTerm , indexShard .getGlobalCheckpoint (), null , ThreadPool .Names .INDEX , "" );
592
+ indexShard .acquireReplicaOperationPermit (primaryTerm , indexShard .getGlobalCheckpoint (), null , ThreadPool .Names .BULK , "" );
593
593
fail ("shard shouldn't accept operations as replica" );
594
594
} catch (IllegalStateException ignored ) {
595
595
@@ -608,14 +608,14 @@ public void testOperationPermitsOnPrimaryShards() throws InterruptedException, E
608
608
609
609
private Releasable acquirePrimaryOperationPermitBlockingly (IndexShard indexShard ) throws ExecutionException , InterruptedException {
610
610
PlainActionFuture <Releasable > fut = new PlainActionFuture <>();
611
- indexShard .acquirePrimaryOperationPermit (fut , ThreadPool .Names .INDEX , "" );
611
+ indexShard .acquirePrimaryOperationPermit (fut , ThreadPool .Names .BULK , "" );
612
612
return fut .get ();
613
613
}
614
614
615
615
private Releasable acquireReplicaOperationPermitBlockingly (IndexShard indexShard , long opPrimaryTerm )
616
616
throws ExecutionException , InterruptedException {
617
617
PlainActionFuture <Releasable > fut = new PlainActionFuture <>();
618
- indexShard .acquireReplicaOperationPermit (opPrimaryTerm , indexShard .getGlobalCheckpoint (), fut , ThreadPool .Names .INDEX , "" );
618
+ indexShard .acquireReplicaOperationPermit (opPrimaryTerm , indexShard .getGlobalCheckpoint (), fut , ThreadPool .Names .BULK , "" );
619
619
return fut .get ();
620
620
}
621
621
@@ -663,7 +663,7 @@ public void testOperationPermitOnReplicaShards() throws Exception {
663
663
if (shardRouting .primary () == false ) {
664
664
final IllegalStateException e =
665
665
expectThrows (IllegalStateException .class ,
666
- () -> indexShard .acquirePrimaryOperationPermit (null , ThreadPool .Names .INDEX , "" ));
666
+ () -> indexShard .acquirePrimaryOperationPermit (null , ThreadPool .Names .BULK , "" ));
667
667
assertThat (e , hasToString (containsString ("shard " + shardRouting + " is not a primary" )));
668
668
}
669
669
@@ -700,7 +700,7 @@ public void onFailure(Exception e) {
700
700
};
701
701
702
702
indexShard .acquireReplicaOperationPermit (primaryTerm - 1 , SequenceNumbers .UNASSIGNED_SEQ_NO , onLockAcquired ,
703
- ThreadPool .Names .INDEX , "" );
703
+ ThreadPool .Names .BULK , "" );
704
704
705
705
assertFalse (onResponse .get ());
706
706
assertTrue (onFailure .get ());
@@ -1020,7 +1020,7 @@ public void onFailure(Exception e) {
1020
1020
latch .countDown ();
1021
1021
}
1022
1022
},
1023
- ThreadPool .Names .INDEX , "" );
1023
+ ThreadPool .Names .BULK , "" );
1024
1024
};
1025
1025
1026
1026
final long firstIncrement = 1 + (randomBoolean () ? 0 : 1 );
@@ -1381,7 +1381,7 @@ public void onResponse(Releasable releasable) {
1381
1381
super .onResponse (releasable );
1382
1382
}
1383
1383
};
1384
- shard .acquirePrimaryOperationPermit (onLockAcquired , ThreadPool .Names .INDEX , "i_" + i );
1384
+ shard .acquirePrimaryOperationPermit (onLockAcquired , ThreadPool .Names .BULK , "i_" + i );
1385
1385
onLockAcquiredActions .add (onLockAcquired );
1386
1386
}
1387
1387
0 commit comments