Skip to content

Commit

Permalink
Fix RemoteStoreReplicationSourceTests.testGetCheckpointMetadataEmpty. (
Browse files Browse the repository at this point in the history
…opensearch-project#8704)

This change fixes RemoteStoreReplicationSourceTests.testGetCheckpointMetadataEmpty by properly setting replication type
for on primary shards.

Signed-off-by: Marc Handalian <handalm@amazon.com>
Signed-off-by: Kaushal Kumar <ravi.kaushal97@gmail.com>
  • Loading branch information
mch2 authored and kaushalmahi12 committed Sep 12, 2023
1 parent 88c0a1d commit 39a30ca
Showing 1 changed file with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,16 @@ public class RemoteStoreReplicationSourceTests extends OpenSearchIndexLevelRepli

private Store remoteStore;

private final Settings settings = Settings.builder()
.put(IndexMetadata.SETTING_REMOTE_STORE_ENABLED, true)
.put(IndexMetadata.SETTING_REPLICATION_TYPE, ReplicationType.SEGMENT)
.build();

@Override
public void setUp() throws Exception {
super.setUp();

indexShard = newStartedShard(
true,
Settings.builder()
.put(IndexMetadata.SETTING_REMOTE_STORE_ENABLED, true)
.put(IndexMetadata.SETTING_REPLICATION_TYPE, ReplicationType.SEGMENT)
.build(),
new InternalEngineFactory()
);
indexShard = newStartedShard(true, settings, new InternalEngineFactory());

indexDoc(indexShard, "_doc", "1");
indexDoc(indexShard, "_doc", "2");
Expand Down Expand Up @@ -133,7 +131,7 @@ public void testGetCheckpointMetadataEmpty() throws ExecutionException, Interrup
try {
emptyIndexShard = newStartedShard(
true,
Settings.builder().put(IndexMetadata.SETTING_REMOTE_STORE_ENABLED, true).build(),
settings,
new InternalEngineFactory()
);
RemoteSegmentStoreDirectory remoteSegmentStoreDirectory =
Expand Down

0 comments on commit 39a30ca

Please sign in to comment.