mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-09 22:45:04 +00:00
These TODOs don't apply any longer with the repository generation now being tracked consistently so we can remove the workarounds.
This commit is contained in:
parent
3560c0cbf2
commit
1039cae2cc
@ -24,7 +24,6 @@ import org.elasticsearch.common.unit.TimeValue;
|
|||||||
import org.elasticsearch.index.query.QueryBuilders;
|
import org.elasticsearch.index.query.QueryBuilders;
|
||||||
import org.elasticsearch.plugins.Plugin;
|
import org.elasticsearch.plugins.Plugin;
|
||||||
import org.elasticsearch.repositories.RepositoriesService;
|
import org.elasticsearch.repositories.RepositoriesService;
|
||||||
import org.elasticsearch.repositories.RepositoryException;
|
|
||||||
import org.elasticsearch.rest.RestStatus;
|
import org.elasticsearch.rest.RestStatus;
|
||||||
import org.elasticsearch.snapshots.ConcurrentSnapshotExecutionException;
|
import org.elasticsearch.snapshots.ConcurrentSnapshotExecutionException;
|
||||||
import org.elasticsearch.snapshots.SnapshotInfo;
|
import org.elasticsearch.snapshots.SnapshotInfo;
|
||||||
@ -397,7 +396,6 @@ public class SLMSnapshotBlockingIntegTests extends ESIntegTestCase {
|
|||||||
assertAcked(client().execute(ExecuteSnapshotRetentionAction.INSTANCE, new ExecuteSnapshotRetentionAction.Request()).get());
|
assertAcked(client().execute(ExecuteSnapshotRetentionAction.INSTANCE, new ExecuteSnapshotRetentionAction.Request()).get());
|
||||||
logger.info("--> waiting for {} snapshot [{}] to be deleted", expectedUnsuccessfulState, failedSnapshotName.get());
|
logger.info("--> waiting for {} snapshot [{}] to be deleted", expectedUnsuccessfulState, failedSnapshotName.get());
|
||||||
assertBusy(() -> {
|
assertBusy(() -> {
|
||||||
try {
|
|
||||||
try {
|
try {
|
||||||
GetSnapshotsResponse snapshotsStatusResponse = client().admin().cluster()
|
GetSnapshotsResponse snapshotsStatusResponse = client().admin().cluster()
|
||||||
.prepareGetSnapshots(REPO).setSnapshots(failedSnapshotName.get()).get();
|
.prepareGetSnapshots(REPO).setSnapshots(failedSnapshotName.get()).get();
|
||||||
@ -411,11 +409,6 @@ public class SLMSnapshotBlockingIntegTests extends ESIntegTestCase {
|
|||||||
.prepareGetSnapshots(REPO).setSnapshots(successfulSnapshotName.get()).get();
|
.prepareGetSnapshots(REPO).setSnapshots(successfulSnapshotName.get()).get();
|
||||||
SnapshotInfo snapshotInfo = snapshotsStatusResponse.getSnapshots().get(0);
|
SnapshotInfo snapshotInfo = snapshotsStatusResponse.getSnapshots().get(0);
|
||||||
assertEquals(SnapshotState.SUCCESS, snapshotInfo.state());
|
assertEquals(SnapshotState.SUCCESS, snapshotInfo.state());
|
||||||
} catch (RepositoryException re) {
|
|
||||||
// Concurrent status calls and write operations may lead to failures in determining the current repository generation
|
|
||||||
// TODO: Remove this hack once tracking the current repository generation has been made consistent
|
|
||||||
throw new AssertionError(re);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -464,7 +457,6 @@ public class SLMSnapshotBlockingIntegTests extends ESIntegTestCase {
|
|||||||
assertAcked(client().execute(ExecuteSnapshotRetentionAction.INSTANCE, new ExecuteSnapshotRetentionAction.Request()).get());
|
assertAcked(client().execute(ExecuteSnapshotRetentionAction.INSTANCE, new ExecuteSnapshotRetentionAction.Request()).get());
|
||||||
logger.info("--> waiting for {} snapshot to be deleted", snapshotName);
|
logger.info("--> waiting for {} snapshot to be deleted", snapshotName);
|
||||||
assertBusy(() -> {
|
assertBusy(() -> {
|
||||||
try {
|
|
||||||
try {
|
try {
|
||||||
GetSnapshotsResponse snapshotsStatusResponse = client().admin().cluster()
|
GetSnapshotsResponse snapshotsStatusResponse = client().admin().cluster()
|
||||||
.prepareGetSnapshots(REPO).setSnapshots(snapshotName).get();
|
.prepareGetSnapshots(REPO).setSnapshots(snapshotName).get();
|
||||||
@ -473,11 +465,6 @@ public class SLMSnapshotBlockingIntegTests extends ESIntegTestCase {
|
|||||||
// This is what we want to happen
|
// This is what we want to happen
|
||||||
}
|
}
|
||||||
logger.info("--> snapshot [{}] has been deleted", snapshotName);
|
logger.info("--> snapshot [{}] has been deleted", snapshotName);
|
||||||
} catch (RepositoryException re) {
|
|
||||||
// Concurrent status calls and write operations may lead to failures in determining the current repository generation
|
|
||||||
// TODO: Remove this hack once tracking the current repository generation has been made consistent
|
|
||||||
throw new AssertionError(re);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Cancel/delete the snapshot
|
// Cancel/delete the snapshot
|
||||||
@ -489,15 +476,7 @@ public class SLMSnapshotBlockingIntegTests extends ESIntegTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private SnapshotsStatusResponse getSnapshotStatus(String snapshotName) {
|
private SnapshotsStatusResponse getSnapshotStatus(String snapshotName) {
|
||||||
try {
|
|
||||||
return client().admin().cluster().prepareSnapshotStatus(REPO).setSnapshots(snapshotName).get();
|
return client().admin().cluster().prepareSnapshotStatus(REPO).setSnapshots(snapshotName).get();
|
||||||
} catch (RepositoryException e) {
|
|
||||||
// Convert this to an AssertionError so that it can be retried in an assertBusy - this is often a transient error because
|
|
||||||
// concurrent status calls and write operations may lead to failures in determining the current repository generation
|
|
||||||
// TODO: Remove this hack once tracking the current repository generation has been made consistent
|
|
||||||
logger.warn(e);
|
|
||||||
throw new AssertionError(e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createAndPopulateIndex(String indexName) throws InterruptedException {
|
private void createAndPopulateIndex(String indexName) throws InterruptedException {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user