Skip to content

Commit 6df3e11

Browse files
committed
Make recovery action retry timeout configurable (#14022)
Signed-off-by: Gaurav Bafna <gbbafna@amazon.com>
1 parent 8cf895b commit 6df3e11

File tree

4 files changed

+21
-0
lines changed

4 files changed

+21
-0
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
1212
- [Remote Store] Add dynamic cluster settings to set timeout for segments upload to Remote Store ([#13679](https://github.com/opensearch-project/OpenSearch/pull/13679))
1313
- Add getMetadataFields to MapperService ([#13819](https://github.com/opensearch-project/OpenSearch/pull/13819))
1414
- Allow setting query parameters on requests ([#13776](https://github.com/opensearch-project/OpenSearch/issues/13776))
15+
- Add dynamic action retry timeout setting ([#14022](https://github.com/opensearch-project/OpenSearch/issues/14022))
1516
- [Remote Store] Add support to disable flush based on translog reader count ([#14027](https://github.com/opensearch-project/OpenSearch/pull/14027))
1617
- [Query Insights] Add exporter support for top n queries ([#12982](https://github.com/opensearch-project/OpenSearch/pull/12982))
1718
- [Query Insights] Add X-Opaque-Id to search request metadata for top n queries ([#13374](https://github.com/opensearch-project/OpenSearch/pull/13374))

server/src/main/java/org/opensearch/common/settings/ClusterSettings.java

+1
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,7 @@ public void apply(Settings value, Settings current, Settings previous) {
303303
RecoverySettings.INDICES_RECOVERY_ACTIVITY_TIMEOUT_SETTING,
304304
RecoverySettings.INDICES_RECOVERY_INTERNAL_ACTION_TIMEOUT_SETTING,
305305
RecoverySettings.INDICES_RECOVERY_INTERNAL_LONG_ACTION_TIMEOUT_SETTING,
306+
RecoverySettings.INDICES_RECOVERY_INTERNAL_ACTION_RETRY_TIMEOUT_SETTING,
306307
RecoverySettings.INDICES_RECOVERY_MAX_CONCURRENT_FILE_CHUNKS_SETTING,
307308
RecoverySettings.INDICES_RECOVERY_MAX_CONCURRENT_OPERATIONS_SETTING,
308309
RecoverySettings.INDICES_RECOVERY_MAX_CONCURRENT_REMOTE_STORE_STREAMS_SETTING,

server/src/main/java/org/opensearch/indices/recovery/RecoverySettings.java

+8
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,10 @@ public RecoverySettings(Settings settings, ClusterSettings clusterSettings) {
239239
);
240240
clusterSettings.addSettingsUpdateConsumer(INDICES_RECOVERY_ACTIVITY_TIMEOUT_SETTING, this::setActivityTimeout);
241241
clusterSettings.addSettingsUpdateConsumer(INDICES_INTERNAL_REMOTE_UPLOAD_TIMEOUT, this::setInternalRemoteUploadTimeout);
242+
clusterSettings.addSettingsUpdateConsumer(
243+
INDICES_RECOVERY_INTERNAL_ACTION_RETRY_TIMEOUT_SETTING,
244+
this::setInternalActionRetryTimeout
245+
);
242246

243247
}
244248

@@ -323,6 +327,10 @@ public void setInternalRemoteUploadTimeout(TimeValue internalRemoteUploadTimeout
323327
this.internalRemoteUploadTimeout = internalRemoteUploadTimeout;
324328
}
325329

330+
public void setInternalActionRetryTimeout(TimeValue internalActionRetryTimeout) {
331+
this.internalActionRetryTimeout = internalActionRetryTimeout;
332+
}
333+
326334
private void setRecoveryMaxBytesPerSec(ByteSizeValue recoveryMaxBytesPerSec) {
327335
this.recoveryMaxBytesPerSec = recoveryMaxBytesPerSec;
328336
if (recoveryMaxBytesPerSec.getBytes() <= 0) {

server/src/test/java/org/opensearch/indices/recovery/RecoverySettingsDynamicUpdateTests.java

+11
Original file line numberDiff line numberDiff line change
@@ -118,4 +118,15 @@ public void testInternalLongActionTimeout() {
118118
);
119119
assertEquals(new TimeValue(duration, timeUnit), recoverySettings.internalActionLongTimeout());
120120
}
121+
122+
public void testInternalActionRetryTimeout() {
123+
long duration = between(1, 1000);
124+
TimeUnit timeUnit = randomFrom(TimeUnit.MILLISECONDS, TimeUnit.SECONDS, TimeUnit.MINUTES, TimeUnit.HOURS);
125+
clusterSettings.applySettings(
126+
Settings.builder()
127+
.put(RecoverySettings.INDICES_RECOVERY_INTERNAL_ACTION_RETRY_TIMEOUT_SETTING.getKey(), duration, timeUnit)
128+
.build()
129+
);
130+
assertEquals(new TimeValue(duration, timeUnit), recoverySettings.internalActionRetryTimeout());
131+
}
121132
}

0 commit comments

Comments
 (0)