Add cloud.aws.s3.throttle_retries setting

Defaults to `true`.

If anyone is having trouble with this option, you could disable it with `cloud.aws.s3.throttle_retries: false` in `elasticsearch.yml` file.
This commit is contained in:
David Pilato 2016-04-15 14:52:27 +02:00
parent f2ee759ad5
commit 44080a007f
3 changed files with 6 additions and 0 deletions

View File

@ -151,6 +151,10 @@ public interface AwsS3Service extends LifecycleComponent<AwsS3Service> {
* cloud.aws.s3.endpoint: Endpoint. If not set, endpoint will be guessed based on region setting.
*/
Setting<String> ENDPOINT_SETTING = Setting.simpleString("cloud.aws.s3.endpoint", Property.NodeScope);
/**
* cloud.aws.s3.throttle_retries: Set to `true` if you want to throttle retries. Defaults to `true`.
*/
Setting<Boolean> THROTTLE_RETRIES_SETTING = Setting.boolSetting("cloud.aws.s3.throttle_retries", true, Property.NodeScope);
}
AmazonS3 client(String endpoint, Protocol protocol, String region, String account, String key, Integer maxRetries);

View File

@ -101,6 +101,7 @@ public class InternalAwsS3Service extends AbstractLifecycleComponent<AwsS3Servic
if (maxRetries != null) {
// If not explicitly set, default to 3 with exponential backoff policy
clientConfiguration.setMaxErrorRetry(maxRetries);
clientConfiguration.setUseThrottleRetries(AwsS3Service.CLOUD_S3.THROTTLE_RETRIES_SETTING.get(settings));
}
// #155: we might have 3rd party users using older S3 API version

View File

@ -112,6 +112,7 @@ public class S3RepositoryPlugin extends Plugin {
settingsModule.registerSetting(AwsS3Service.CLOUD_S3.SIGNER_SETTING);
settingsModule.registerSetting(AwsS3Service.CLOUD_S3.REGION_SETTING);
settingsModule.registerSetting(AwsS3Service.CLOUD_S3.ENDPOINT_SETTING);
settingsModule.registerSetting(AwsS3Service.CLOUD_S3.THROTTLE_RETRIES_SETTING);
// Register S3 repositories settings: repositories.s3
settingsModule.registerSetting(S3Repository.Repositories.KEY_SETTING);