Skip to content

Commit a28ef33

Browse files
committed
Rename retention lease setting (#39719)
This commit renames the retention lease setting index.soft_deletes.retention.lease so that it is under the namespace index.soft_deletes.retention_lease. As such, we rename the setting to index.soft_deletes.retention_lease.period.
1 parent 290c877 commit a28ef33

File tree

6 files changed

+11
-11
lines changed

6 files changed

+11
-11
lines changed

server/src/main/java/org/elasticsearch/common/settings/IndexScopedSettings.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ public final class IndexScopedSettings extends AbstractScopedSettings {
133133
IndexSettings.INDEX_GC_DELETES_SETTING,
134134
IndexSettings.INDEX_SOFT_DELETES_SETTING,
135135
IndexSettings.INDEX_SOFT_DELETES_RETENTION_OPERATIONS_SETTING,
136-
IndexSettings.INDEX_SOFT_DELETES_RETENTION_LEASE_SETTING,
136+
IndexSettings.INDEX_SOFT_DELETES_RETENTION_LEASE_PERIOD_SETTING,
137137
IndicesRequestCache.INDEX_CACHE_REQUEST_ENABLED_SETTING,
138138
UnassignedInfo.INDEX_DELAYED_NODE_LEFT_TIMEOUT_SETTING,
139139
EnableAllocationDecider.INDEX_ROUTING_REBALANCE_ENABLE_SETTING,

server/src/main/java/org/elasticsearch/index/IndexSettings.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -261,9 +261,9 @@ public final class IndexSettings {
261261
/**
262262
* Controls the maximum length of time since a retention lease is created or renewed before it is considered expired.
263263
*/
264-
public static final Setting<TimeValue> INDEX_SOFT_DELETES_RETENTION_LEASE_SETTING =
264+
public static final Setting<TimeValue> INDEX_SOFT_DELETES_RETENTION_LEASE_PERIOD_SETTING =
265265
Setting.timeSetting(
266-
"index.soft_deletes.retention.lease",
266+
"index.soft_deletes.retention_lease.period",
267267
TimeValue.timeValueHours(12),
268268
TimeValue.ZERO,
269269
Property.Dynamic,
@@ -460,7 +460,7 @@ public IndexSettings(final IndexMetaData indexMetaData, final Settings nodeSetti
460460
gcDeletesInMillis = scopedSettings.get(INDEX_GC_DELETES_SETTING).getMillis();
461461
softDeleteEnabled = version.onOrAfter(Version.V_6_5_0) && scopedSettings.get(INDEX_SOFT_DELETES_SETTING);
462462
softDeleteRetentionOperations = scopedSettings.get(INDEX_SOFT_DELETES_RETENTION_OPERATIONS_SETTING);
463-
retentionLeaseMillis = scopedSettings.get(INDEX_SOFT_DELETES_RETENTION_LEASE_SETTING).millis();
463+
retentionLeaseMillis = scopedSettings.get(INDEX_SOFT_DELETES_RETENTION_LEASE_PERIOD_SETTING).millis();
464464
warmerEnabled = scopedSettings.get(INDEX_WARMER_ENABLED_SETTING);
465465
maxResultWindow = scopedSettings.get(MAX_RESULT_WINDOW_SETTING);
466466
maxInnerResultWindow = scopedSettings.get(MAX_INNER_RESULT_WINDOW_SETTING);
@@ -529,7 +529,7 @@ public IndexSettings(final IndexMetaData indexMetaData, final Settings nodeSetti
529529
scopedSettings.addSettingsUpdateConsumer(DEFAULT_PIPELINE, this::setDefaultPipeline);
530530
scopedSettings.addSettingsUpdateConsumer(INDEX_SOFT_DELETES_RETENTION_OPERATIONS_SETTING, this::setSoftDeleteRetentionOperations);
531531
scopedSettings.addSettingsUpdateConsumer(INDEX_SEARCH_THROTTLED, this::setSearchThrottled);
532-
scopedSettings.addSettingsUpdateConsumer(INDEX_SOFT_DELETES_RETENTION_LEASE_SETTING, this::setRetentionLeaseMillis);
532+
scopedSettings.addSettingsUpdateConsumer(INDEX_SOFT_DELETES_RETENTION_LEASE_PERIOD_SETTING, this::setRetentionLeaseMillis);
533533
}
534534

535535
private void setSearchIdleAfter(TimeValue searchIdleAfter) { this.searchIdleAfter = searchIdleAfter; }

server/src/test/java/org/elasticsearch/index/seqno/ReplicationTrackerRetentionLeaseTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ private void runExpirationTest(final boolean primaryMode) {
337337
final Settings settings = Settings
338338
.builder()
339339
.put(
340-
IndexSettings.INDEX_SOFT_DELETES_RETENTION_LEASE_SETTING.getKey(),
340+
IndexSettings.INDEX_SOFT_DELETES_RETENTION_LEASE_PERIOD_SETTING.getKey(),
341341
TimeValue.timeValueMillis(retentionLeaseMillis))
342342
.build();
343343
final long primaryTerm = randomLongBetween(1, Long.MAX_VALUE);

server/src/test/java/org/elasticsearch/index/seqno/RetentionLeaseIT.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ public void testRetentionLeasesSyncOnExpiration() throws Exception {
210210
.prepareUpdateSettings("index")
211211
.setSettings(
212212
Settings.builder()
213-
.putNull(IndexSettings.INDEX_SOFT_DELETES_RETENTION_LEASE_SETTING.getKey())
213+
.putNull(IndexSettings.INDEX_SOFT_DELETES_RETENTION_LEASE_PERIOD_SETTING.getKey())
214214
.build())
215215
.get();
216216
assertTrue(longTtlResponse.isAcknowledged());
@@ -240,7 +240,7 @@ public void testRetentionLeasesSyncOnExpiration() throws Exception {
240240
.prepareUpdateSettings("index")
241241
.setSettings(
242242
Settings.builder()
243-
.put(IndexSettings.INDEX_SOFT_DELETES_RETENTION_LEASE_SETTING.getKey(), retentionLeaseTimeToLive)
243+
.put(IndexSettings.INDEX_SOFT_DELETES_RETENTION_LEASE_PERIOD_SETTING.getKey(), retentionLeaseTimeToLive)
244244
.build())
245245
.get();
246246
assertTrue(shortTtlResponse.isAcknowledged());

server/src/test/java/org/elasticsearch/index/shard/IndexShardRetentionLeaseTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ private void runExpirationTest(final boolean primary) throws IOException {
144144
final Settings settings = Settings
145145
.builder()
146146
.put(
147-
IndexSettings.INDEX_SOFT_DELETES_RETENTION_LEASE_SETTING.getKey(),
147+
IndexSettings.INDEX_SOFT_DELETES_RETENTION_LEASE_PERIOD_SETTING.getKey(),
148148
TimeValue.timeValueMillis(retentionLeaseMillis))
149149
.build();
150150
// current time is mocked through the thread pool
@@ -211,7 +211,7 @@ private void runExpirationTest(final boolean primary) throws IOException {
211211
public void testPersistence() throws IOException {
212212
final Settings settings = Settings.builder()
213213
.put(IndexSettings.INDEX_SOFT_DELETES_SETTING.getKey(), true)
214-
.put(IndexSettings.INDEX_SOFT_DELETES_RETENTION_LEASE_SETTING.getKey(), Long.MAX_VALUE, TimeUnit.NANOSECONDS)
214+
.put(IndexSettings.INDEX_SOFT_DELETES_RETENTION_LEASE_PERIOD_SETTING.getKey(), Long.MAX_VALUE, TimeUnit.NANOSECONDS)
215215
.build();
216216
final IndexShard indexShard = newStartedShard(
217217
true,

x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/action/TransportResumeFollowAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ static String[] extractLeaderShardHistoryUUIDs(Map<String, String> ccrIndexMetaD
386386
nonReplicatedSettings.add(IndexSettings.ALLOW_UNMAPPED);
387387
nonReplicatedSettings.add(IndexSettings.INDEX_SEARCH_IDLE_AFTER);
388388
nonReplicatedSettings.add(IndexSettings.INDEX_SOFT_DELETES_RETENTION_OPERATIONS_SETTING);
389-
nonReplicatedSettings.add(IndexSettings.INDEX_SOFT_DELETES_RETENTION_LEASE_SETTING);
389+
nonReplicatedSettings.add(IndexSettings.INDEX_SOFT_DELETES_RETENTION_LEASE_PERIOD_SETTING);
390390
nonReplicatedSettings.add(IndexSettings.MAX_SCRIPT_FIELDS_SETTING);
391391
nonReplicatedSettings.add(IndexSettings.MAX_REGEX_LENGTH_SETTING);
392392
nonReplicatedSettings.add(IndexSettings.MAX_TERMS_COUNT_SETTING);

0 commit comments

Comments
 (0)