Skip to content

Commit 398fc50

Browse files
authored
Fix name of UNSAFELY_INCOMPATIBLE_WITH_S3_CONDITIONAL_WRITES (#138406)
In #137185 we introduced a new S3 repository setting called `unsafely_incompatible_with_s3_conditional_writes` but named the code symbol `UNSAFELY_INCOMPATIBLE_WITH_S3_WRITES` omitting the "conditional" bit. That makes the dependent code confusing to read, so this commit fixes the symbol name.
1 parent 0674e23 commit 398fc50

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

modules/repository-s3/src/javaRestTest/java/org/elasticsearch/repositories/s3/RepositoryS3ConditionalWritesUnsupportedRestIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public void handle(HttpExchange exchange) throws IOException {
9797
protected Settings extraRepositorySettings() {
9898
return Settings.builder()
9999
.put(super.extraRepositorySettings())
100-
.put(S3Repository.UNSAFELY_INCOMPATIBLE_WITH_S3_WRITES.getKey(), true)
100+
.put(S3Repository.UNSAFELY_INCOMPATIBLE_WITH_S3_CONDITIONAL_WRITES.getKey(), true)
101101
.build();
102102
}
103103

modules/repository-s3/src/main/java/org/elasticsearch/repositories/s3/S3BlobStore.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,7 @@ public void addPurposeQueryParameter(OperationPurpose purpose, AwsRequestOverrid
630630
/**
631631
* Some storage claims S3-compatibility despite failing to support the {@code If-Match} and {@code If-None-Match} functionality
632632
* properly. We allow to disable the use of this functionality, making all writes unconditional, using the
633-
* {@link S3Repository#UNSAFELY_INCOMPATIBLE_WITH_S3_WRITES} setting.
633+
* {@link S3Repository#UNSAFELY_INCOMPATIBLE_WITH_S3_CONDITIONAL_WRITES} setting.
634634
*/
635635
public boolean supportsConditionalWrites(OperationPurpose purpose) {
636636
// REPOSITORY_ANALYSIS is a strict check for 100% S3 compatibility, including conditional write support

modules/repository-s3/src/main/java/org/elasticsearch/repositories/s3/S3Repository.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ class S3Repository extends MeteredBlobStoreRepository {
249249
Setting.Property.Dynamic
250250
);
251251

252-
static final Setting<Boolean> UNSAFELY_INCOMPATIBLE_WITH_S3_WRITES = Setting.boolSetting(
252+
static final Setting<Boolean> UNSAFELY_INCOMPATIBLE_WITH_S3_CONDITIONAL_WRITES = Setting.boolSetting(
253253
"unsafely_incompatible_with_s3_conditional_writes",
254254
false
255255
);
@@ -279,7 +279,7 @@ class S3Repository extends MeteredBlobStoreRepository {
279279
/**
280280
* Some storage claims S3-compatibility despite failing to support the {@code If-Match} and {@code If-None-Match} functionality
281281
* properly. We allow to disable the use of this functionality, making all writes unconditional, using the
282-
* {@link #UNSAFELY_INCOMPATIBLE_WITH_S3_WRITES} setting.
282+
* {@link #UNSAFELY_INCOMPATIBLE_WITH_S3_CONDITIONAL_WRITES} setting.
283283
*/
284284
private final boolean supportsConditionalWrites;
285285

@@ -359,7 +359,7 @@ class S3Repository extends MeteredBlobStoreRepository {
359359
}
360360

361361
coolDown = COOLDOWN_PERIOD.get(metadata.settings());
362-
supportsConditionalWrites = UNSAFELY_INCOMPATIBLE_WITH_S3_WRITES.get(metadata.settings()) == Boolean.FALSE;
362+
supportsConditionalWrites = UNSAFELY_INCOMPATIBLE_WITH_S3_CONDITIONAL_WRITES.get(metadata.settings()) == Boolean.FALSE;
363363

364364
if (supportsConditionalWrites == false) {
365365
logger.warn(
@@ -368,7 +368,7 @@ class S3Repository extends MeteredBlobStoreRepository {
368368
this warning, upgrade your storage to a system that is fully compatible with AWS S3 and then remove the [{}] \
369369
repository setting; for more information, see [{}]""",
370370
metadata.name(),
371-
UNSAFELY_INCOMPATIBLE_WITH_S3_WRITES.getKey(),
371+
UNSAFELY_INCOMPATIBLE_WITH_S3_CONDITIONAL_WRITES.getKey(),
372372
ReferenceDocs.S3_COMPATIBLE_REPOSITORIES
373373
);
374374
}

modules/repository-s3/src/test/java/org/elasticsearch/repositories/s3/S3BlobContainerRetriesTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ protected BlobContainer createBlobContainer(
249249
S3Repository.MAX_COPY_SIZE_BEFORE_MULTIPART.getDefault(Settings.EMPTY),
250250
S3Repository.CANNED_ACL_SETTING.getDefault(Settings.EMPTY),
251251
S3Repository.STORAGE_CLASS_SETTING.getDefault(Settings.EMPTY),
252-
S3Repository.UNSAFELY_INCOMPATIBLE_WITH_S3_WRITES.getDefault(Settings.EMPTY),
252+
S3Repository.UNSAFELY_INCOMPATIBLE_WITH_S3_CONDITIONAL_WRITES.getDefault(Settings.EMPTY),
253253
repositoryMetadata,
254254
BigArrays.NON_RECYCLING_INSTANCE,
255255
new DeterministicTaskQueue().getThreadPool(),

0 commit comments

Comments
 (0)