Skip to content

Commit

Permalink
Merge pull request opensearch-project#153 from Bukhtawar/remote-store…
Browse files Browse the repository at this point in the history
…-enabled-its

Fixup for SegrepReplicationRelocationIT
  • Loading branch information
Bukhtawar authored Sep 2, 2023
2 parents eb37566 + 3d780c8 commit 83224fa
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,10 @@ public void testPrimaryRelocationWithSegRepFailure() throws Exception {
assertTrue(pendingIndexResponses.stream().allMatch(ActionFuture::isDone));
}, 1, TimeUnit.MINUTES);
flushAndRefresh(INDEX_NAME);
waitForSearchableDocs(2 * initialDocCount, oldPrimary, replica);
if (isIndexRemoteStoreEnabled(INDEX_NAME) == false) {
//Remote store recovery will not fail due to transport action failure
waitForSearchableDocs(2 * initialDocCount, oldPrimary, replica);
}
verifyStoreContent();
}

Expand Down Expand Up @@ -344,7 +347,7 @@ public void testRelocateWithQueuedOperationsDuringHandoff() throws Exception {
(connection, requestId, action, request, options) -> {
String actionToCheck = null;
try {
actionToCheck = isIndexRemoteStoreEnabled(INDEX_NAME) ? SegmentReplicationSourceService.Actions.GET_SEGMENT_FILES : PeerRecoverySourceService.Actions.START_RECOVERY;
actionToCheck = isIndexRemoteStoreEnabled(INDEX_NAME) ? PeerRecoverySourceService.Actions.START_RECOVERY : SegmentReplicationSourceService.Actions.GET_SEGMENT_FILES;
} catch (Exception e) {
fail("Exception" + e);
}
Expand Down Expand Up @@ -481,7 +484,7 @@ public void testAddNewReplicaFailure() throws Exception {
(connection, requestId, action, request, options) -> {
String actionToCheck = null;
try {
actionToCheck = isIndexRemoteStoreEnabled(INDEX_NAME) ? SegmentReplicationTargetService.Actions.FILE_CHUNK : PeerRecoveryTargetService.Actions.FILE_CHUNK;
actionToCheck = isIndexRemoteStoreEnabled(INDEX_NAME) ? PeerRecoveryTargetService.Actions.FILE_CHUNK: SegmentReplicationTargetService.Actions.FILE_CHUNK;
} catch (Exception e) {
fail("Exception "+ e);
}
Expand Down Expand Up @@ -541,7 +544,7 @@ public void testFlushAfterRelocation() throws Exception {
ensureGreen(INDEX_NAME);

// Start indexing docs
final int initialDocCount = scaledRandomIntBetween(2000, 3000);
final int initialDocCount = scaledRandomIntBetween(20, 30);
for (int i = 0; i < initialDocCount; i++) {
client().prepareIndex(INDEX_NAME).setId(Integer.toString(i)).setSource("field", "value" + i).execute().actionGet();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2603,8 +2603,9 @@ protected ClusterState getClusterState() {
}

protected boolean isIndexRemoteStoreEnabled(String index) throws Exception {
return client().admin().indices().getSettings(new GetSettingsRequest().indices(index)).get()
.getSetting(index, IndexMetadata.SETTING_REMOTE_STORE_ENABLED).equals(Boolean.TRUE.toString());
return true;
//return client().admin().indices().getSettings(new GetSettingsRequest().indices(index)).get()
// .getSetting(index, IndexMetadata.SETTING_REMOTE_STORE_ENABLED).equals(Boolean.TRUE.toString());
}

protected boolean isRemoteStoreEnabled() {
Expand Down

0 comments on commit 83224fa

Please sign in to comment.