Skip to content

Commit

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

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

Signed-off-by: Marc Handalian <handalm@amazon.com>
(cherry picked from commit 675acdb)
  • Loading branch information
mch2 authored Jul 14, 2023
1 parent 27d812b commit 6548b5f
Showing 1 changed file with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.opensearch.index.store.RemoteSegmentStoreDirectory;
import org.opensearch.index.store.Store;
import org.opensearch.indices.replication.checkpoint.ReplicationCheckpoint;
import org.opensearch.indices.replication.common.ReplicationType;

import java.io.IOException;
import java.util.Collections;
Expand All @@ -44,14 +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).build(),
new InternalEngineFactory()
);

indexShard = newStartedShard(true, settings, new InternalEngineFactory());

indexDoc(indexShard, "_doc", "1");
indexDoc(indexShard, "_doc", "2");
Expand Down Expand Up @@ -128,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 6548b5f

Please sign in to comment.