Skip to content

Commit a9fa0cb

Browse files
committed
Rework retries in reindex
We want 500ms for the first retry and about a minute of total retries.
1 parent 7ca2651 commit a9fa0cb

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

plugins/reindex/src/main/java/org/elasticsearch/plugin/reindex/AbstractBulkByScrollRequest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,14 @@ public abstract class AbstractBulkByScrollRequest<Self extends AbstractBulkByScr
7676

7777
/**
7878
* Initial delay after a rejection before retrying a bulk request. With the default maxRetries the total backoff for retrying rejections
79-
* is about 25 seconds per bulk request. Once the entire bulk request is successful the retry counter resets.
79+
* is about one minute per bulk request. Once the entire bulk request is successful the retry counter resets.
8080
*/
81-
private TimeValue retryBackoffInitialTime = timeValueMillis(50);
81+
private TimeValue retryBackoffInitialTime = timeValueMillis(500);
8282

8383
/**
8484
* Total number of retries attempted for rejections. There is no way to ask for unlimited retries.
8585
*/
86-
private int maxRetries = 10;
86+
private int maxRetries = 11;
8787

8888
public AbstractBulkByScrollRequest() {
8989
}

plugins/reindex/src/test/java/org/elasticsearch/plugin/reindex/AsyncBulkByScrollActionTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ public void testDefaultRetryTimes() {
356356
* This is the total number of milliseconds that a reindex made with the default settings will backoff before attempting one final
357357
* time. If that request is rejected then the whole process fails with a rejected exception.
358358
*/
359-
int defaultBackoffBeforeFailing = 24670;
359+
int defaultBackoffBeforeFailing = 59460;
360360
assertEquals(defaultBackoffBeforeFailing, millis);
361361
}
362362

0 commit comments

Comments
 (0)