@@ -195,24 +195,6 @@ public final class IndexSettings {
195
195
new ByteSizeValue (Long .MAX_VALUE , ByteSizeUnit .BYTES ),
196
196
Property .Dynamic , Property .IndexScope );
197
197
198
- /**
199
- * Controls how long translog files that are no longer needed for persistence reasons
200
- * will be kept around before being deleted. A longer retention policy is useful to increase
201
- * the chance of ops based recoveries.
202
- **/
203
- public static final Setting <TimeValue > INDEX_TRANSLOG_RETENTION_AGE_SETTING =
204
- Setting .timeSetting ("index.translog.retention.age" , TimeValue .timeValueHours (12 ), TimeValue .timeValueMillis (-1 ),
205
- Property .Dynamic , Property .IndexScope );
206
-
207
- /**
208
- * Controls how many translog files that are no longer needed for persistence reasons
209
- * will be kept around before being deleted. Keeping more files is useful to increase
210
- * the chance of ops based recoveries.
211
- **/
212
- public static final Setting <ByteSizeValue > INDEX_TRANSLOG_RETENTION_SIZE_SETTING =
213
- Setting .byteSizeSetting ("index.translog.retention.size" , new ByteSizeValue (512 , ByteSizeUnit .MB ), Property .Dynamic ,
214
- Property .IndexScope );
215
-
216
198
/**
217
199
* The maximum size of a translog generation. This is independent of the maximum size of
218
200
* translog operations that have not been flushed.
@@ -258,6 +240,23 @@ public final class IndexSettings {
258
240
Setting .longSetting ("index.soft_deletes.retention.operations" , 0 , 0 ,
259
241
Property .IndexScope , Property .Dynamic );
260
242
243
+ /**
244
+ * Controls how long translog files that are no longer needed for persistence reasons
245
+ * will be kept around before being deleted.
246
+ **/
247
+ public static final Setting <TimeValue > INDEX_TRANSLOG_RETENTION_AGE_SETTING =
248
+ Setting .timeSetting ("index.translog.retention.age" ,
249
+ settings -> INDEX_SOFT_DELETES_SETTING .get (settings ) ? TimeValue .ZERO : TimeValue .timeValueHours (12 ), TimeValue .MINUS_ONE ,
250
+ Property .Dynamic , Property .IndexScope );
251
+
252
+ /**
253
+ * Controls how many translog files that are no longer needed for persistence reasons
254
+ * will be kept around before being deleted.
255
+ **/
256
+ public static final Setting <ByteSizeValue > INDEX_TRANSLOG_RETENTION_SIZE_SETTING =
257
+ Setting .byteSizeSetting ("index.translog.retention.size" , settings -> INDEX_SOFT_DELETES_SETTING .get (settings ) ? "0b" : "512mb" ,
258
+ Property .Dynamic , Property .IndexScope );
259
+
261
260
/**
262
261
* Controls the maximum length of time since a retention lease is created or renewed before it is considered expired.
263
262
*/
0 commit comments