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