Fix SharedClusterSnapshotRestoreIT.testThrottling (#61323) (#61328)

We have to set the recovery setting to `0` if we don't want throttling
from recoveries. Otherwise the randomized value used for this setting in
tests can lead to throttling unexpectedly.

Closes #61311
This commit is contained in:
Armin Braun 2020-08-19 15:26:32 +02:00 committed by GitHub
parent 70128e022b
commit 4a53ae203e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 4 deletions

View File

@ -1726,10 +1726,9 @@ public class SharedClusterSnapshotRestoreIT extends AbstractSnapshotIntegTestCas
cluster().wipeIndices("test-idx");
logger.info("--> restore index");
if (throttleRestoreViaRecoverySettings) {
client.admin().cluster().prepareUpdateSettings().setTransientSettings(Settings.builder()
.put(INDICES_RECOVERY_MAX_BYTES_PER_SEC_SETTING.getKey(), "10k").build()).get();
}
client.admin().cluster().prepareUpdateSettings().setTransientSettings(Settings.builder()
.put(INDICES_RECOVERY_MAX_BYTES_PER_SEC_SETTING.getKey(),
throttleRestoreViaRecoverySettings ? "10k" : "0").build()).get();
RestoreSnapshotResponse restoreSnapshotResponse = client.admin().cluster().prepareRestoreSnapshot("test-repo", "test-snap")
.setWaitForCompletion(true).execute().actionGet();
assertThat(restoreSnapshotResponse.getRestoreInfo().totalShards(), greaterThan(0));