Skip to content

Commit

Permalink
Fixup for SegrepReplicationRelocationIT
Browse files Browse the repository at this point in the history
Signed-off-by: Bukhtawar Khan <bukhtawa@amazon.com>
  • Loading branch information
Bukhtawar committed Sep 2, 2023
1 parent 393a7af commit 5dc0e3f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
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
Expand Up @@ -2601,8 +2601,7 @@ 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;
}

}

0 comments on commit 5dc0e3f

Please sign in to comment.