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 <[email protected]>
  • Loading branch information
mch2 authored Jul 14, 2023
1 parent 7e8740f commit 675acdb
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 675acdb

Please sign in to comment.