|
@@ -90,7 +90,7 @@ public class SharedClusterSnapshotRestoreTests extends AbstractSnapshotTests {
|
|
|
logger.info("--> creating repository");
|
|
|
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
|
|
.setType("fs").setSettings(ImmutableSettings.settingsBuilder()
|
|
|
- .put("location", createTempDir())
|
|
|
+ .put("location", randomRepoPath())
|
|
|
.put("compress", randomBoolean())
|
|
|
.put("chunk_size", randomIntBetween(100, 1000))));
|
|
|
|
|
@@ -185,7 +185,7 @@ public class SharedClusterSnapshotRestoreTests extends AbstractSnapshotTests {
|
|
|
String indexName = "testindex";
|
|
|
String repoName = "test-restore-snapshot-repo";
|
|
|
String snapshotName = "test-restore-snapshot";
|
|
|
- String absolutePath = createTempDir().toAbsolutePath().toString();
|
|
|
+ String absolutePath = randomRepoPath().toAbsolutePath().toString();
|
|
|
logger.info("Path [{}]", absolutePath);
|
|
|
String restoredIndexName = indexName + "-restored";
|
|
|
String typeName = "actions";
|
|
@@ -231,7 +231,7 @@ public class SharedClusterSnapshotRestoreTests extends AbstractSnapshotTests {
|
|
|
logger.info("--> creating repository");
|
|
|
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
|
|
.setType("fs").setSettings(ImmutableSettings.settingsBuilder()
|
|
|
- .put("location", createTempDir())
|
|
|
+ .put("location", randomRepoPath())
|
|
|
.put("compress", randomBoolean())
|
|
|
.put("chunk_size", randomIntBetween(100, 1000))));
|
|
|
|
|
@@ -280,7 +280,7 @@ public class SharedClusterSnapshotRestoreTests extends AbstractSnapshotTests {
|
|
|
logger.info("--> creating repository");
|
|
|
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
|
|
.setType("fs").setSettings(ImmutableSettings.settingsBuilder()
|
|
|
- .put("location", createTempDir())
|
|
|
+ .put("location", randomRepoPath())
|
|
|
.put("compress", randomBoolean())
|
|
|
.put("chunk_size", randomIntBetween(100, 1000))));
|
|
|
|
|
@@ -328,7 +328,7 @@ public class SharedClusterSnapshotRestoreTests extends AbstractSnapshotTests {
|
|
|
|
|
|
logger.info("--> creating repository");
|
|
|
PutRepositoryResponse putRepositoryResponse = client.admin().cluster().preparePutRepository("test-repo")
|
|
|
- .setType("fs").setSettings(ImmutableSettings.settingsBuilder().put("location", createTempDir())).get();
|
|
|
+ .setType("fs").setSettings(ImmutableSettings.settingsBuilder().put("location", randomRepoPath())).get();
|
|
|
assertThat(putRepositoryResponse.isAcknowledged(), equalTo(true));
|
|
|
|
|
|
logger.info("--> snapshot");
|
|
@@ -345,7 +345,7 @@ public class SharedClusterSnapshotRestoreTests extends AbstractSnapshotTests {
|
|
|
|
|
|
logger.info("--> creating repository");
|
|
|
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
|
|
- .setType("fs").setSettings(ImmutableSettings.settingsBuilder().put("location", createTempDir())));
|
|
|
+ .setType("fs").setSettings(ImmutableSettings.settingsBuilder().put("location", randomRepoPath())));
|
|
|
|
|
|
logger.info("--> create test indices");
|
|
|
createIndex("test-idx-1", "test-idx-2", "test-idx-3");
|
|
@@ -401,7 +401,7 @@ public class SharedClusterSnapshotRestoreTests extends AbstractSnapshotTests {
|
|
|
|
|
|
logger.info("--> creating repository");
|
|
|
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
|
|
- .setType("fs").setSettings(ImmutableSettings.settingsBuilder().put("location", createTempDir())));
|
|
|
+ .setType("fs").setSettings(ImmutableSettings.settingsBuilder().put("location", randomRepoPath())));
|
|
|
|
|
|
logger.info("--> creating test template");
|
|
|
assertThat(client.admin().indices().preparePutTemplate("test-template").setTemplate("te*").addMapping("test-mapping", "{}").get().isAcknowledged(), equalTo(true));
|
|
@@ -433,7 +433,7 @@ public class SharedClusterSnapshotRestoreTests extends AbstractSnapshotTests {
|
|
|
Client client = client();
|
|
|
|
|
|
logger.info("--> creating repository");
|
|
|
- Path location = createTempDir();
|
|
|
+ Path location = randomRepoPath();
|
|
|
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
|
|
.setType("fs").setSettings(ImmutableSettings.settingsBuilder().put("location", location)));
|
|
|
|
|
@@ -515,7 +515,7 @@ public class SharedClusterSnapshotRestoreTests extends AbstractSnapshotTests {
|
|
|
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
|
|
.setType(MockRepositoryModule.class.getCanonicalName()).setSettings(
|
|
|
ImmutableSettings.settingsBuilder()
|
|
|
- .put("location", createTempDir())
|
|
|
+ .put("location", randomRepoPath())
|
|
|
.put("random", randomAsciiOfLength(10))
|
|
|
.put("random_control_io_exception_rate", 0.2))
|
|
|
.setVerify(false));
|
|
@@ -565,7 +565,7 @@ public class SharedClusterSnapshotRestoreTests extends AbstractSnapshotTests {
|
|
|
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
|
|
.setType(MockRepositoryModule.class.getCanonicalName()).setSettings(
|
|
|
ImmutableSettings.settingsBuilder()
|
|
|
- .put("location", createTempDir())
|
|
|
+ .put("location", randomRepoPath())
|
|
|
.put("random", randomAsciiOfLength(10))
|
|
|
.put("random_data_file_io_exception_rate", 0.3)));
|
|
|
|
|
@@ -627,7 +627,7 @@ public class SharedClusterSnapshotRestoreTests extends AbstractSnapshotTests {
|
|
|
|
|
|
@Test
|
|
|
public void dataFileFailureDuringRestoreTest() throws Exception {
|
|
|
- Path repositoryLocation = createTempDir();
|
|
|
+ Path repositoryLocation = randomRepoPath();
|
|
|
Client client = client();
|
|
|
logger.info("--> creating repository");
|
|
|
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
|
@@ -669,7 +669,7 @@ public class SharedClusterSnapshotRestoreTests extends AbstractSnapshotTests {
|
|
|
|
|
|
@Test
|
|
|
public void deletionOfFailingToRecoverIndexShouldStopRestore() throws Exception {
|
|
|
- Path repositoryLocation = createTempDir();
|
|
|
+ Path repositoryLocation = randomRepoPath();
|
|
|
Client client = client();
|
|
|
logger.info("--> creating repository");
|
|
|
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
|
@@ -738,7 +738,7 @@ public class SharedClusterSnapshotRestoreTests extends AbstractSnapshotTests {
|
|
|
logger.info("--> creating repository");
|
|
|
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
|
|
.setType("fs").setSettings(ImmutableSettings.settingsBuilder()
|
|
|
- .put("location", createTempDir())));
|
|
|
+ .put("location", randomRepoPath())));
|
|
|
|
|
|
logger.info("--> creating index that cannot be allocated");
|
|
|
prepareCreate("test-idx", 2, ImmutableSettings.builder().put(FilterAllocationDecider.INDEX_ROUTING_INCLUDE_GROUP + ".tag", "nowhere").put("index.number_of_shards", 3)).get();
|
|
@@ -756,7 +756,7 @@ public class SharedClusterSnapshotRestoreTests extends AbstractSnapshotTests {
|
|
|
final int numberOfSnapshots = between(5, 15);
|
|
|
Client client = client();
|
|
|
|
|
|
- Path repo = createTempDir();
|
|
|
+ Path repo = randomRepoPath();
|
|
|
logger.info("--> creating repository at " + repo.toAbsolutePath());
|
|
|
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
|
|
.setType("fs").setSettings(ImmutableSettings.settingsBuilder()
|
|
@@ -813,7 +813,7 @@ public class SharedClusterSnapshotRestoreTests extends AbstractSnapshotTests {
|
|
|
public void deleteSnapshotWithMissingIndexAndShardMetadataTest() throws Exception {
|
|
|
Client client = client();
|
|
|
|
|
|
- Path repo = createTempDir();
|
|
|
+ Path repo = randomRepoPath();
|
|
|
logger.info("--> creating repository at " + repo.toAbsolutePath());
|
|
|
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
|
|
.setType("fs").setSettings(ImmutableSettings.settingsBuilder()
|
|
@@ -852,7 +852,7 @@ public class SharedClusterSnapshotRestoreTests extends AbstractSnapshotTests {
|
|
|
public void deleteSnapshotWithMissingMetadataTest() throws Exception {
|
|
|
Client client = client();
|
|
|
|
|
|
- Path repo = createTempDir();
|
|
|
+ Path repo = randomRepoPath();
|
|
|
logger.info("--> creating repository at " + repo.toAbsolutePath());
|
|
|
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
|
|
.setType("fs").setSettings(ImmutableSettings.settingsBuilder()
|
|
@@ -887,7 +887,7 @@ public class SharedClusterSnapshotRestoreTests extends AbstractSnapshotTests {
|
|
|
public void deleteSnapshotWithCorruptedSnapshotFileTest() throws Exception {
|
|
|
Client client = client();
|
|
|
|
|
|
- Path repo = createTempDir();
|
|
|
+ Path repo = randomRepoPath();
|
|
|
logger.info("--> creating repository at " + repo.toAbsolutePath());
|
|
|
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
|
|
.setType("fs").setSettings(ImmutableSettings.settingsBuilder()
|
|
@@ -932,7 +932,7 @@ public class SharedClusterSnapshotRestoreTests extends AbstractSnapshotTests {
|
|
|
logger.info("--> creating repository");
|
|
|
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
|
|
.setType("fs").setSettings(ImmutableSettings.settingsBuilder()
|
|
|
- .put("location", createTempDir())));
|
|
|
+ .put("location", randomRepoPath())));
|
|
|
|
|
|
createIndex("test-idx", "test-idx-closed");
|
|
|
ensureGreen();
|
|
@@ -970,7 +970,7 @@ public class SharedClusterSnapshotRestoreTests extends AbstractSnapshotTests {
|
|
|
logger.info("--> creating repository");
|
|
|
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
|
|
.setType("fs").setSettings(ImmutableSettings.settingsBuilder()
|
|
|
- .put("location", createTempDir())));
|
|
|
+ .put("location", randomRepoPath())));
|
|
|
|
|
|
createIndex("test-idx");
|
|
|
ensureGreen();
|
|
@@ -991,7 +991,7 @@ public class SharedClusterSnapshotRestoreTests extends AbstractSnapshotTests {
|
|
|
logger.info("--> creating repository");
|
|
|
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
|
|
.setType("fs").setSettings(ImmutableSettings.settingsBuilder()
|
|
|
- .put("location", createTempDir())));
|
|
|
+ .put("location", randomRepoPath())));
|
|
|
|
|
|
createIndex("test-idx-1", "test-idx-2", "test-idx-3");
|
|
|
ensureGreen();
|
|
@@ -1107,7 +1107,7 @@ public class SharedClusterSnapshotRestoreTests extends AbstractSnapshotTests {
|
|
|
@Test
|
|
|
public void moveShardWhileSnapshottingTest() throws Exception {
|
|
|
Client client = client();
|
|
|
- Path repositoryLocation = createTempDir();
|
|
|
+ Path repositoryLocation = randomRepoPath();
|
|
|
logger.info("--> creating repository");
|
|
|
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
|
|
.setType(MockRepositoryModule.class.getCanonicalName()).setSettings(
|
|
@@ -1169,7 +1169,7 @@ public class SharedClusterSnapshotRestoreTests extends AbstractSnapshotTests {
|
|
|
@Test
|
|
|
public void deleteRepositoryWhileSnapshottingTest() throws Exception {
|
|
|
Client client = client();
|
|
|
- Path repositoryLocation = createTempDir();
|
|
|
+ Path repositoryLocation = randomRepoPath();
|
|
|
logger.info("--> creating repository");
|
|
|
PutRepositoryResponse putRepositoryResponse = client.admin().cluster().preparePutRepository("test-repo")
|
|
|
.setType(MockRepositoryModule.class.getCanonicalName()).setSettings(
|
|
@@ -1254,7 +1254,7 @@ public class SharedClusterSnapshotRestoreTests extends AbstractSnapshotTests {
|
|
|
Client client = client();
|
|
|
|
|
|
logger.info("--> creating repository");
|
|
|
- Path repositoryLocation = createTempDir();
|
|
|
+ Path repositoryLocation = randomRepoPath();
|
|
|
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
|
|
.setType("fs").setSettings(ImmutableSettings.settingsBuilder()
|
|
|
.put("location", repositoryLocation)
|
|
@@ -1312,7 +1312,7 @@ public class SharedClusterSnapshotRestoreTests extends AbstractSnapshotTests {
|
|
|
Client client = client();
|
|
|
|
|
|
logger.info("--> creating repository");
|
|
|
- Path repositoryLocation = createTempDir();
|
|
|
+ Path repositoryLocation = randomRepoPath();
|
|
|
boolean throttleSnapshot = randomBoolean();
|
|
|
boolean throttleRestore = randomBoolean();
|
|
|
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
|
@@ -1370,7 +1370,7 @@ public class SharedClusterSnapshotRestoreTests extends AbstractSnapshotTests {
|
|
|
@Test
|
|
|
public void snapshotStatusTest() throws Exception {
|
|
|
Client client = client();
|
|
|
- Path repositoryLocation = createTempDir();
|
|
|
+ Path repositoryLocation = randomRepoPath();
|
|
|
logger.info("--> creating repository");
|
|
|
PutRepositoryResponse putRepositoryResponse = client.admin().cluster().preparePutRepository("test-repo")
|
|
|
.setType(MockRepositoryModule.class.getCanonicalName()).setSettings(
|
|
@@ -1473,7 +1473,7 @@ public class SharedClusterSnapshotRestoreTests extends AbstractSnapshotTests {
|
|
|
logger.info("--> creating repository");
|
|
|
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
|
|
.setType("fs").setSettings(ImmutableSettings.settingsBuilder()
|
|
|
- .put("location", createTempDir())
|
|
|
+ .put("location", randomRepoPath())
|
|
|
.put("compress", randomBoolean())
|
|
|
.put("chunk_size", randomIntBetween(100, 1000))));
|
|
|
|
|
@@ -1521,7 +1521,7 @@ public class SharedClusterSnapshotRestoreTests extends AbstractSnapshotTests {
|
|
|
logger.info("--> creating repository");
|
|
|
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
|
|
.setType("fs").setSettings(ImmutableSettings.settingsBuilder()
|
|
|
- .put("location", createTempDir())
|
|
|
+ .put("location", randomRepoPath())
|
|
|
.put("compress", randomBoolean())
|
|
|
.put("chunk_size", randomIntBetween(100, 1000))));
|
|
|
|
|
@@ -1584,7 +1584,7 @@ public class SharedClusterSnapshotRestoreTests extends AbstractSnapshotTests {
|
|
|
logger.info("--> creating repository");
|
|
|
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
|
|
.setType("fs").setSettings(ImmutableSettings.settingsBuilder()
|
|
|
- .put("location", createTempDir())
|
|
|
+ .put("location", randomRepoPath())
|
|
|
.put("compress", randomBoolean())
|
|
|
.put("chunk_size", randomIntBetween(100, 1000))));
|
|
|
|
|
@@ -1701,7 +1701,7 @@ public class SharedClusterSnapshotRestoreTests extends AbstractSnapshotTests {
|
|
|
logger.info("--> creating repository");
|
|
|
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
|
|
.setType(MockRepositoryModule.class.getCanonicalName()).setSettings(ImmutableSettings.settingsBuilder()
|
|
|
- .put("location", createTempDir())
|
|
|
+ .put("location", randomRepoPath())
|
|
|
.put("compress", randomBoolean())
|
|
|
.put("chunk_size", randomIntBetween(100, 1000))
|
|
|
.put("block_on_init", true)
|
|
@@ -1753,7 +1753,7 @@ public class SharedClusterSnapshotRestoreTests extends AbstractSnapshotTests {
|
|
|
logger.info("--> creating repository");
|
|
|
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
|
|
.setType(MockRepositoryModule.class.getCanonicalName()).setSettings(ImmutableSettings.settingsBuilder()
|
|
|
- .put("location", createTempDir())
|
|
|
+ .put("location", randomRepoPath())
|
|
|
.put("compress", randomBoolean())
|
|
|
.put("chunk_size", randomIntBetween(100, 1000))
|
|
|
));
|
|
@@ -1833,7 +1833,7 @@ public class SharedClusterSnapshotRestoreTests extends AbstractSnapshotTests {
|
|
|
logger.info("--> creating repository");
|
|
|
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
|
|
.setType("fs").setSettings(ImmutableSettings.settingsBuilder()
|
|
|
- .put("location", createTempDir())
|
|
|
+ .put("location", randomRepoPath())
|
|
|
.put("compress", randomBoolean())
|
|
|
.put("chunk_size", randomIntBetween(100, 1000))));
|
|
|
|