@@ -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" ,
@@ -555,21 +571,6 @@ public void testSnapshotShutdownProgressTracker() throws Exception {
555
571
mockLog .awaitAllExpectationsMatched ();
556
572
resetMockLog ();
557
573
558
- // Block on the master when a shard snapshot request comes in, until we can verify that the Tracker saw the outgoing request.
559
- final CountDownLatch snapshotStatusUpdateLatch = new CountDownLatch (1 );
560
- final var masterTransportService = MockTransportService .getInstance (internalCluster ().getMasterName ());
561
- masterTransportService .addRequestHandlingBehavior (
562
- SnapshotsService .UPDATE_SNAPSHOT_STATUS_ACTION_NAME ,
563
- (handler , request , channel , task ) -> masterTransportService .getThreadPool ().generic ().execute (() -> {
564
- safeAwait (snapshotStatusUpdateLatch );
565
- try {
566
- handler .messageReceived (request , channel , task );
567
- } catch (Exception e ) {
568
- fail (e );
569
- }
570
- })
571
- );
572
-
573
574
mockLog .addExpectation (
574
575
new MockLog .SeenEventExpectation (
575
576
"SnapshotShutdownProgressTracker shard snapshot has paused log message" ,
0 commit comments