Skip to content

Commit

Permalink
Don't set retries for restore snapshot
Browse files Browse the repository at this point in the history
With this commit we use the standard retry handling from the
Elasticsearch client. Previously, we've implemented a special logic to
add a `retries` parameter but it is ineffective and instead is passed a
request parameter to Elasticsearch.

Relates elastic#799
  • Loading branch information
danielmitterdorfer authored Oct 18, 2019
1 parent 0aee2cf commit 864f0c5
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
9 changes: 0 additions & 9 deletions esrally/driver/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -1158,15 +1158,6 @@ class RestoreSnapshot(Runner):
"""
def __call__(self, es, params):
request_params = params.get("request-params", {})
if "retries" not in request_params:
# It is possible that there is a proxy in between the cluster and our client which has a shorter timeout
# configured. In that case, the proxy would return 504, the client would retry the operation and hit an
# error about an index that is already existing. This error message is confusing and thus we explicitly
# disallow the client to ever retry.
#
# see also the docs for ``retries`` in the ``urllib3.connectionpool.urlopen``.
request_params["retries"] = 0

es.snapshot.restore(repository=mandatory(params, "repository", repr(self)),
snapshot=mandatory(params, "snapshot", repr(self)),
body=params.get("body"),
Expand Down
5 changes: 1 addition & 4 deletions tests/driver/runner_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2070,10 +2070,7 @@ def test_restore_snapshot_with_body(self, es):
}
},
wait_for_completion=True,
params={
"request_timeout": 7200,
"retries": 0
})
params={"request_timeout": 7200})


class IndicesRecoveryTests(TestCase):
Expand Down

0 comments on commit 864f0c5

Please sign in to comment.