@@ -483,6 +483,7 @@ public void testSnapshotShutdownProgressTracker() throws Exception {
483
483
final var otherNode = internalCluster ().startDataOnlyNode ();
484
484
final var otherIndex = randomIdentifier ();
485
485
createIndexWithContent (otherIndex , indexSettings (numShards , 0 ).put (REQUIRE_NODE_NAME_SETTING , otherNode ).build ());
486
+ indexAllShardsToAnEqualOrGreaterMinimumSize (otherIndex , ByteSizeValue .of (2 , ByteSizeUnit .KB ).getBytes ());
486
487
blockDataNode (repoName , otherNode );
487
488
488
489
final var nodeForRemoval = internalCluster ().startDataOnlyNode (
@@ -493,6 +494,7 @@ public void testSnapshotShutdownProgressTracker() throws Exception {
493
494
final var indexName = randomIdentifier ();
494
495
createIndexWithContent (indexName , indexSettings (numShards , 0 ).put (REQUIRE_NODE_NAME_SETTING , nodeForRemoval ).build ());
495
496
indexAllShardsToAnEqualOrGreaterMinimumSize (indexName , ByteSizeValue .of (2 , ByteSizeUnit .KB ).getBytes ());
497
+ logger .info ("---> nodeForRemovalId: " + nodeForRemovalId + ", numShards: " + numShards );
496
498
497
499
// Start the snapshot with blocking in place on the data node not to allow shard snapshots to finish yet.
498
500
final var clusterService = internalCluster ().getCurrentMasterNodeInstance (ClusterService .class );
@@ -502,7 +504,21 @@ public void testSnapshotShutdownProgressTracker() throws Exception {
502
504
503
505
waitForBlock (otherNode , repoName );
504
506
505
- logger .info ("---> nodeForRemovalId: " + nodeForRemovalId + ", numShards: " + numShards );
507
+ // Block on the master when a shard snapshot request comes in, until we can verify that the Tracker saw the outgoing request.
508
+ final CountDownLatch snapshotStatusUpdateLatch = new CountDownLatch (1 );
509
+ final var masterTransportService = MockTransportService .getInstance (internalCluster ().getMasterName ());
510
+ masterTransportService .addRequestHandlingBehavior (
511
+ TransportUpdateSnapshotStatusAction .NAME ,
512
+ (handler , request , channel , task ) -> masterTransportService .getThreadPool ().generic ().execute (() -> {
513
+ safeAwait (snapshotStatusUpdateLatch );
514
+ try {
515
+ handler .messageReceived (request , channel , task );
516
+ } catch (Exception e ) {
517
+ fail (e );
518
+ }
519
+ })
520
+ );
521
+
506
522
mockLog .addExpectation (
507
523
new MockLog .SeenEventExpectation (
508
524
"SnapshotShutdownProgressTracker start log message" ,
@@ -550,21 +566,6 @@ public void testSnapshotShutdownProgressTracker() throws Exception {
550
566
mockLog .awaitAllExpectationsMatched ();
551
567
resetMockLog ();
552
568
553
- // Block on the master when a shard snapshot request comes in, until we can verify that the Tracker saw the outgoing request.
554
- final CountDownLatch snapshotStatusUpdateLatch = new CountDownLatch (1 );
555
- final var masterTransportService = MockTransportService .getInstance (internalCluster ().getMasterName ());
556
- masterTransportService .addRequestHandlingBehavior (
557
- TransportUpdateSnapshotStatusAction .NAME ,
558
- (handler , request , channel , task ) -> masterTransportService .getThreadPool ().generic ().execute (() -> {
559
- safeAwait (snapshotStatusUpdateLatch );
560
- try {
561
- handler .messageReceived (request , channel , task );
562
- } catch (Exception e ) {
563
- fail (e );
564
- }
565
- })
566
- );
567
-
568
569
mockLog .addExpectation (
569
570
new MockLog .SeenEventExpectation (
570
571
"SnapshotShutdownProgressTracker shard snapshot has paused log message" ,
0 commit comments