@@ -644,25 +644,6 @@ public void testDoNotCancelForBrokenNode() {
644
644
assertThat (allocation .routingNodes ().shardsWithState (ShardRoutingState .UNASSIGNED ), empty ());
645
645
}
646
646
647
- public void testDoNotCancelForInactivePrimaryNode () {
648
- RoutingAllocation allocation = oneInactivePrimaryOnNode1And1ReplicaRecovering (yesAllocationDeciders (), null );
649
- testBatchAllocator .addData (
650
- node1 ,
651
- null ,
652
- "MATCH" ,
653
- null ,
654
- new StoreFileMetadata ("file1" , 10 , "MATCH_CHECKSUM" , MIN_SUPPORTED_LUCENE_VERSION )
655
- ).addData (node2 , randomSyncId (), null , new StoreFileMetadata ("file1" , 10 , "MATCH_CHECKSUM" , MIN_SUPPORTED_LUCENE_VERSION ));
656
-
657
- testBatchAllocator .processExistingRecoveries (
658
- allocation ,
659
- Collections .singletonList (new ArrayList <>(allocation .routingNodes ().shardsWithState (ShardRoutingState .INITIALIZING )))
660
- );
661
-
662
- assertThat (allocation .routingNodesChanged (), equalTo (false ));
663
- assertThat (allocation .routingNodes ().shardsWithState (ShardRoutingState .UNASSIGNED ), empty ());
664
- }
665
-
666
647
public void testAllocateUnassignedBatchThrottlingAllocationDeciderIsHonoured () throws InterruptedException {
667
648
ClusterSettings clusterSettings = new ClusterSettings (Settings .EMPTY , ClusterSettings .BUILT_IN_CLUSTER_SETTINGS );
668
649
AllocationDeciders allocationDeciders = randomAllocationDeciders (
@@ -936,41 +917,6 @@ private RoutingAllocation onePrimaryOnNode1And1ReplicaRecovering(AllocationDecid
936
917
);
937
918
}
938
919
939
- private RoutingAllocation oneInactivePrimaryOnNode1And1ReplicaRecovering (AllocationDeciders deciders , UnassignedInfo unassignedInfo ) {
940
- ShardRouting primaryShard = TestShardRouting .newShardRouting (shardId , node1 .getId (), true , ShardRoutingState .INITIALIZING );
941
- RoutingTable routingTable = RoutingTable .builder ()
942
- .add (
943
- IndexRoutingTable .builder (shardId .getIndex ())
944
- .addIndexShard (
945
- new IndexShardRoutingTable .Builder (shardId ).addShard (primaryShard )
946
- .addShard (
947
- TestShardRouting .newShardRouting (
948
- shardId ,
949
- node2 .getId (),
950
- null ,
951
- false ,
952
- ShardRoutingState .INITIALIZING ,
953
- unassignedInfo
954
- )
955
- )
956
- .build ()
957
- )
958
- )
959
- .build ();
960
- ClusterState state = ClusterState .builder (org .opensearch .cluster .ClusterName .CLUSTER_NAME_SETTING .getDefault (Settings .EMPTY ))
961
- .routingTable (routingTable )
962
- .nodes (DiscoveryNodes .builder ().add (node1 ).add (node2 ))
963
- .build ();
964
- return new RoutingAllocation (
965
- deciders ,
966
- new RoutingNodes (state , false ),
967
- state ,
968
- ClusterInfo .EMPTY ,
969
- SnapshotShardSizeInfo .EMPTY ,
970
- System .nanoTime ()
971
- );
972
- }
973
-
974
920
private RoutingAllocation onePrimaryOnNode1And1ReplicaRecovering (AllocationDeciders deciders ) {
975
921
return onePrimaryOnNode1And1ReplicaRecovering (deciders , new UnassignedInfo (UnassignedInfo .Reason .CLUSTER_RECOVERED , null ));
976
922
}
0 commit comments