@@ -65,6 +65,7 @@ import org.opensearch.index.mapper.MapperService
6565import org.opensearch.repositories.fs.FsRepository
6666import org.opensearch.test.OpenSearchTestCase.assertBusy
6767import org.junit.Assert
68+ import org.opensearch.cluster.metadata.AliasMetadata
6869import org.opensearch.common.xcontent.DeprecationHandler
6970import org.opensearch.common.xcontent.NamedXContentRegistry
7071import org.opensearch.replication.ReplicationPlugin.Companion.REPLICATION_INDEX_TRANSLOG_PRUNING_ENABLED_SETTING
@@ -344,8 +345,10 @@ class StartReplicationIT: MultiClusterRestTestCase() {
344345
345346 createConnectionBetweenClusters(FOLLOWER , LEADER )
346347
347- val createIndexResponse = leaderClient.indices().create(CreateIndexRequest (leaderIndexName).alias(Alias (" leaderAlias" )), RequestOptions .DEFAULT )
348- assertThat(createIndexResponse.isAcknowledged).isTrue()
348+ val createIndexResponse = leaderClient.indices().create(CreateIndexRequest (leaderIndexName)
349+ .alias(Alias (" leaderAlias" ).filter(" {\" term\" :{\" year\" :2016}}" ).routing(" 1" ))
350+ , RequestOptions .DEFAULT )
351+ assertThat(createIndexResponse.isAcknowledged).isTrue
349352 try {
350353 followerClient.startReplication(StartReplicationRequest (" source" , leaderIndexName, followerIndexName),
351354 waitForRestore = true )
@@ -361,6 +364,7 @@ class StartReplicationIT: MultiClusterRestTestCase() {
361364 followerClient.indices().getAlias(GetAliasesRequest ().indices(followerIndexName),
362365 RequestOptions .DEFAULT ).aliases[followerIndexName]
363366 )
367+
364368 }, 30L , TimeUnit .SECONDS )
365369 } finally {
366370 followerClient.stopReplication(followerIndexName)
@@ -541,7 +545,7 @@ class StartReplicationIT: MultiClusterRestTestCase() {
541545 var indicesAliasesRequest = IndicesAliasesRequest ()
542546 var aliasAction = IndicesAliasesRequest .AliasActions .add()
543547 .index(leaderIndexName)
544- .alias(" alias1" )
548+ .alias(" alias1" ).filter( " { \" term \" :{ \" year \" :2016}} " ).routing( " 1 " )
545549 indicesAliasesRequest.addAliasAction(aliasAction)
546550 leaderClient.indices().updateAliases(indicesAliasesRequest, RequestOptions .DEFAULT )
547551
0 commit comments