Skip to content

Commit

Permalink
Drop support for Elasticsearch 1.x
Browse files Browse the repository at this point in the history
With this commit we remove support in Rally to benchmark Elasticsearch
1.x.

Closes elastic#715
  • Loading branch information
danielmitterdorfer committed Jun 17, 2019
1 parent 659ef10 commit e84ac47
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 20 deletions.
18 changes: 4 additions & 14 deletions esrally/driver/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -643,11 +643,7 @@ def scroll_query(self, es, params):
# This should only happen if we concurrently create an index and start searching
self.scroll_id = r.get("_scroll_id", None)
else:
# This does only work for ES 2.x and above
# r = es.scroll(body={"scroll_id": self.scroll_id, "scroll": "10s"})
# This is the most compatible version to perform a scroll across all supported versions of Elasticsearch
# (1.x does not support a proper JSON body in search scroll requests).
r = self.es.transport.perform_request("GET", "/_search/scroll", params={"scroll_id": self.scroll_id, "scroll": "10s"})
r = es.scroll(body={"scroll_id": self.scroll_id, "scroll": "10s"})
hit_count = len(r["hits"]["hits"])
timed_out = timed_out or r["timed_out"]
took += r["took"]
Expand Down Expand Up @@ -678,15 +674,10 @@ def _default_request_params(self, params):
def __exit__(self, exc_type, exc_val, exc_tb):
if self.scroll_id and self.es:
try:
# This does only work for ES 2.x and above
# self.es.clear_scroll(body={"scroll_id": [self.scroll_id]})

# This is the most compatible version to clear one scroll id across all supported versions of Elasticsearch
# (1.x does not support a proper JSON body in clear scroll requests).
self.es.transport.perform_request("DELETE", "/_search/scroll/%s" % self.scroll_id)
self.es.clear_scroll(body={"scroll_id": [self.scroll_id]})
except BaseException:
self.logger.exception("Could not clear scroll [%s]. This will lead to excessive resource usage in Elasticsearch and will "
"skew your benchmark results.", self.scroll_id)
self.logger.exception("Could not clear scroll [%s]. This will lead to excessive resource usage in "
"Elasticsearch and will skew your benchmark results.", self.scroll_id)
self.scroll_id = None
self.es = None
return False
Expand All @@ -703,7 +694,6 @@ class ClusterHealth(Runner):
def __call__(self, es, params):
from enum import Enum
from functools import total_ordering
from elasticsearch.client import _make_path

@total_ordering
class ClusterHealthStatus(Enum):
Expand Down
2 changes: 1 addition & 1 deletion integration-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ set -e

readonly CONFIGURATIONS=(integration-test es-integration-test)

readonly DISTRIBUTIONS=(1.7.6 2.4.6 5.6.9)
readonly DISTRIBUTIONS=(2.4.6 5.6.16 6.8.0 7.1.1)
readonly TRACKS=(geonames nyc_taxis http_logs nested)

readonly ES_METRICS_STORE_JAVA_HOME="${JAVA8_HOME}"
Expand Down
8 changes: 4 additions & 4 deletions tests/driver/runner_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1116,7 +1116,7 @@ def test_scroll_query_with_explicit_number_of_pages(self, es):
]
}
}
es.transport.perform_request.side_effect = [
es.scroll.side_effect = [
# page 2
{
"_scroll_id": "some-scroll-id",
Expand Down Expand Up @@ -1178,7 +1178,7 @@ def test_scroll_query_early_termination(self, es):
]
}
}
es.transport.perform_request.side_effect = [
es.scroll.side_effect = [
# page 2 has no results
{
"_scroll_id": "some-scroll-id",
Expand Down Expand Up @@ -1236,7 +1236,7 @@ def test_scroll_query_cannot_clear_scroll(self, es):
]
}
}
es.transport.perform_request.side_effect = [
es.scroll.side_effect = [
# page 2 has no results
{
"_scroll_id": "some-scroll-id",
Expand Down Expand Up @@ -1300,7 +1300,7 @@ def test_scroll_query_request_all_pages(self, es):
]
}
}
es.transport.perform_request.side_effect = [
es.scroll.side_effect = [
# page 2 has no results
{
"_scroll_id": "some-scroll-id",
Expand Down
1 change: 0 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ deps =
pytest-benchmark==3.1.1
passenv =
HOME
JAVA7_HOME
JAVA8_HOME
JAVA9_HOME
JAVA10_HOME
Expand Down

0 comments on commit e84ac47

Please sign in to comment.