Skip to content

Commit 69d4564

Browse files
committed
Add support to run RemoteStoreIT with S3 integration
Signed-off-by: Ashish Singh <ssashish@amazon.com>
1 parent 9bef705 commit 69d4564

File tree

19 files changed

+1811
-1180
lines changed

19 files changed

+1811
-1180
lines changed

plugins/repository-s3/build.gradle

+3
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ test {
141141
// this is tested explicitly in separate test tasks
142142
exclude '**/RepositoryCredentialsTests.class'
143143
exclude '**/S3RepositoryThirdPartyTests.class'
144+
exclude '**/S3RemoteStoreIT.class'
144145
}
145146

146147
boolean useFixture = false
@@ -252,6 +253,7 @@ processYamlRestTestResources {
252253
internalClusterTest {
253254
// this is tested explicitly in a separate test task
254255
exclude '**/S3RepositoryThirdPartyTests.class'
256+
exclude '**/S3RemoteStoreIT.class'
255257
}
256258

257259
yamlRestTest {
@@ -408,6 +410,7 @@ TaskProvider s3ThirdPartyTest = tasks.register("s3ThirdPartyTest", Test) {
408410
setTestClassesDirs(internalTestSourceSet.getOutput().getClassesDirs())
409411
setClasspath(internalTestSourceSet.getRuntimeClasspath())
410412
include '**/S3RepositoryThirdPartyTests.class'
413+
include '**/S3RemoteStoreIT.class'
411414
systemProperty 'test.s3.account', s3PermanentAccessKey
412415
systemProperty 'test.s3.key', s3PermanentSecretKey
413416
systemProperty 'test.s3.bucket', s3PermanentBucket

plugins/repository-s3/src/internalClusterTest/java/org/opensearch/repositories/s3/S3RemoteStoreIT.java

+373
Large diffs are not rendered by default.

plugins/repository-s3/src/main/java/org/opensearch/repositories/s3/S3BlobContainer.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ private <T> T getFutureValue(PlainActionFuture<T> future) throws IOException {
392392
return future.get();
393393
} catch (InterruptedException e) {
394394
Thread.currentThread().interrupt();
395-
throw new IllegalStateException("Future got interrupted", e);
395+
throw new IOException("Future got interrupted", e);
396396
} catch (ExecutionException e) {
397397
if (e.getCause() instanceof IOException) {
398398
throw (IOException) e.getCause();

plugins/repository-s3/src/main/java/org/opensearch/repositories/s3/S3ClientSettings.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
/**
6464
* A container for settings used to create an S3 client.
6565
*/
66-
final class S3ClientSettings {
66+
public final class S3ClientSettings {
6767

6868
private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(S3ClientSettings.class);
6969

plugins/repository-s3/src/main/plugin-metadata/plugin-security.policy

+4
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ grant {
6060
permission java.util.PropertyPermission "aws.sharedCredentialsFile", "read,write";
6161
permission java.util.PropertyPermission "aws.configFile", "read,write";
6262
permission java.util.PropertyPermission "opensearch.path.conf", "read,write";
63+
permission java.util.PropertyPermission "test.s3.account", "read,write";
64+
permission java.util.PropertyPermission "test.s3.key", "read,write";
65+
permission java.util.PropertyPermission "test.s3.bucket", "read,write";
66+
permission java.util.PropertyPermission "test.s3.endpoint", "read,write";
6367
permission java.io.FilePermission "config", "read";
6468

6569
permission java.lang.RuntimePermission "accessDeclaredMembers";

server/src/internalClusterTest/java/org/opensearch/remotestore/RemoteStoreIT.java

+4-1,149
Large diffs are not rendered by default.

server/src/internalClusterTest/java/org/opensearch/remotestore/multipart/RemoteStoreMultipartIT.java server/src/internalClusterTest/java/org/opensearch/remotestore/multipart/RemoteStoreMultipartBaseIT.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import org.opensearch.common.unit.TimeValue;
1515
import org.opensearch.core.common.unit.ByteSizeUnit;
1616
import org.opensearch.plugins.Plugin;
17-
import org.opensearch.remotestore.RemoteStoreIT;
17+
import org.opensearch.remotestore.RemoteStoreBaseIT;
1818
import org.opensearch.remotestore.multipart.mocks.MockFsRepositoryPlugin;
1919
import org.opensearch.repositories.RepositoriesService;
2020
import org.opensearch.repositories.blobstore.BlobStoreRepository;
@@ -34,7 +34,7 @@
3434
import static org.hamcrest.Matchers.equalTo;
3535
import static org.hamcrest.Matchers.greaterThan;
3636

37-
public class RemoteStoreMultipartIT extends RemoteStoreIT {
37+
public class RemoteStoreMultipartBaseIT extends RemoteStoreBaseIT {
3838

3939
Path repositoryLocation;
4040
boolean compress;

server/src/main/java/org/opensearch/index/translog/RemoteFsTimestampAwareTranslog.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ protected void trimUnreferencedReaders(boolean indexDeleted, boolean trimLocal)
146146

147147
// This is to fail fast and avoid listing md files un-necessarily.
148148
if (indexDeleted == false && RemoteStoreUtils.isPinnedTimestampStateStale()) {
149-
logger.warn("Skipping remote translog garbage collection as last fetch of pinned timestamp is stale");
149+
logger.debug("Skipping remote translog garbage collection as last fetch of pinned timestamp is stale");
150150
return;
151151
}
152152

@@ -179,7 +179,7 @@ public void onResponse(List<BlobMetadata> blobMetadata) {
179179

180180
// Check last fetch status of pinned timestamps. If stale, return.
181181
if (indexDeleted == false && RemoteStoreUtils.isPinnedTimestampStateStale()) {
182-
logger.warn("Skipping remote translog garbage collection as last fetch of pinned timestamp is stale");
182+
logger.debug("Skipping remote translog garbage collection as last fetch of pinned timestamp is stale");
183183
remoteGenerationDeletionPermits.release(REMOTE_DELETION_PERMITS);
184184
return;
185185
}

0 commit comments

Comments
 (0)