Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend existing IndexRecoveryIT for remote indexes #8505

Merged
merged 7 commits into from
Jul 10, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix flaky behavior
Signed-off-by: Ashish Singh <ssashish@amazon.com>
  • Loading branch information
ashking94 committed Jul 10, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 59fe10ac539b9baf612e43597cc91d442fdc0729
Original file line number Diff line number Diff line change
@@ -688,23 +688,11 @@ public void testRerouteRecovery() throws Exception {
assertOnGoingRecoveryState(nodeCRecoveryStates.get(0), 0, PeerRecoverySource.INSTANCE, false, nodeB, nodeC);
validateIndexRecoveryState(nodeCRecoveryStates.get(0).getIndex());

if (randomBoolean()) {
if (randomBoolean() && shouldAssertOngoingRecoveryInRerouteRecovery()) {
// shutdown node with relocation source of replica shard and check if recovery continues
internalCluster().stopRandomNode(InternalTestCluster.nameFilter(nodeA));
ensureStableCluster(2);

if (indexFurtherInRerouteRecoveryBeforeAssertOngoingRecovery()) {
logger.info("--> indexing sample data");
final int numDocs = numDocs();
final IndexRequestBuilder[] docs = new IndexRequestBuilder[numDocs];

for (int i = 0; i < numDocs; i++) {
docs[i] = client().prepareIndex(INDEX_NAME)
.setSource("foo-int", randomInt(), "foo-string", randomAlphaOfLength(32), "foo-float", randomFloat());
}
indexRandom(true, docs);
}

response = client().admin().indices().prepareRecoveries(INDEX_NAME).execute().actionGet();
recoveryStates = response.shardRecoveryStates().get(INDEX_NAME);

@@ -744,7 +732,7 @@ public void testRerouteRecovery() throws Exception {
validateIndexRecoveryState(nodeCRecoveryStates.get(0).getIndex());
}

protected boolean indexFurtherInRerouteRecoveryBeforeAssertOngoingRecovery() {
protected boolean shouldAssertOngoingRecoveryInRerouteRecovery() {
return false;
}

Original file line number Diff line number Diff line change
@@ -78,12 +78,7 @@ protected int numDocs() {
}

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

@Override
protected boolean indexFurtherInRerouteRecoveryBeforeAssertOngoingRecovery() {
return true;
protected boolean shouldAssertOngoingRecoveryInRerouteRecovery() {
return false;
}
}