Skip to content

Commit

Permalink
Remove automatic index management
Browse files Browse the repository at this point in the history
With this commit we remove the ability that Rally automatically deletes
and creates indices and users need to add explicit tasks now to their
tracks in order to make this work.

The rationale behind all this work is that we want the core of Rally to
be agnostic to the tasks that it executes.

Closes #380
Relates #456
  • Loading branch information
danielmitterdorfer committed Apr 6, 2018
1 parent 05a2793 commit 76b29cc
Show file tree
Hide file tree
Showing 12 changed files with 174 additions and 533 deletions.
9 changes: 5 additions & 4 deletions docs/adding_tracks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,11 @@ For details on the allowed syntax, see the Elasticsearch documentation on `mappi
Finally, add a file called ``track.json`` in the tutorial directory::

{
"version": 2,
"description": "Tutorial benchmark for Rally",
"indices": [
{
"name": "geonames",
"auto-managed": false,
"body": "index.json",
"types": [ "docs" ]
}
Expand Down Expand Up @@ -285,11 +285,11 @@ Structuring your track
Now modify ``track.json`` so it knows about your new file::

{
"version": 2,
"description": "Tutorial benchmark for Rally",
"indices": [
{
"name": "geonames",
"auto-managed": false,
"body": "index.json",
"types": [ "docs" ]
}
Expand All @@ -316,11 +316,11 @@ We replaced the challenge content with ``{% include "challenges/index-and-query
If you want to reuse operation definitions across challenges, you can also define them in a separate ``operations`` block and just refer to them by name in the corresponding challenge::

{
"version": 2,
"description": "Tutorial benchmark for Rally",
"indices": [
{
"name": "geonames",
"auto-managed": false,
"body": "index.json",
"types": [ "docs" ]
}
Expand Down Expand Up @@ -416,11 +416,11 @@ If your track consists of multiple challenges, it can be cumbersome to include t

{% import "rally.helpers" as rally %}
{
"version": 2,
"description": "Tutorial benchmark for Rally",
"indices": [
{
"name": "geonames",
"auto-managed": false,
"body": "index.json",
"types": [ "docs" ]
}
Expand Down Expand Up @@ -512,6 +512,7 @@ Then upload ``documents.json.bz2`` and ``documents-1k.json.bz2`` to the remote l
Finally, specify the compressed file name in your ``track.json`` file in the ``source-file`` property and also add the ``base-url`` property::

{
"version": 2,
"description": "Tutorial benchmark for Rally",
"corpora": [
{
Expand Down
16 changes: 0 additions & 16 deletions docs/command_line_reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -456,22 +456,6 @@ Rally usually installs and launches an Elasticsearch cluster internally and wipe
.. note::
This option does only affect clusters that are provisioned by Rally. More specifically, if you use the pipeline ``benchmark-only``, this option is ineffective as Rally does not provision a cluster in this case.

``cluster-health``
~~~~~~~~~~~~~~~~~~

.. warning::
This option is deprecated and will be removed in a future version of Rally. For details, please see the respective `Github ticket #364 <https://github.com/elastic/rally/issues/364>`_.

Rally checks whether the cluster health is "green" before it runs a benchmark against it. The main reason is that we don't want to benchmark a cluster which is shuffling shards around or might start doing so. If you really need to run a benchmark against a cluster that is "yellow" or "red", then you can explicitly override Rally's default behavior. It is even possible to skip this check entirely by providing ``--cluster-health=skip``. But please think twice before doing so and rather eliminate the root cause.

**Example**

::

esrally --cluster-health=yellow



``advanced-config``
~~~~~~~~~~~~~~~~~~~

Expand Down
35 changes: 35 additions & 0 deletions docs/migrate.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,41 @@ Removal of operation type ``index``

We have removed the operation type ``index`` which has been deprecated with Rally 0.8.0. Please use ``bulk`` instead as operation type.

Removal of the command line parameter ``--cluster-health``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

We have removed the command line parameter ``--cluster-health`` which has been deprecated with Rally 0.8.0. When using Rally's standard tracks, specify the expected cluster health as a track parameter instead, e.g.: ``--track-params="cluster_health:'yellow'"``.

Removal of index-automanagement
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

We have removed the possibility that Rally automatically deletes and creates indices. Therefore, you need to add the following definitions explicitly at the beginning of a schedule if you want Rally to create declared indices::

"schedule": [
{
"operation": "delete-index"
},
{
"operation": {
"operation-type": "create-index",
"settings": {
"index.number_of_replicas": 0
}
}
},
{
"operation": {
"operation-type": "cluster-health",
"request-params": {
"wait_for_status": "green"
}
}
}

The example above also shows how to provide per-challenge index settings. If per-challenge index settings are not required, you can just specify them in the index definition file.

This behavior applies similarly to index templates as well.

Migrating to Rally 0.9.0
------------------------

Expand Down
7 changes: 3 additions & 4 deletions docs/track.rst
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ The ``version`` property has been introduced with Rally 0.7.3. Rally versions be
Example::

{
"version": 1,
"version": 2,
"description": "POIs from Geonames"
}

Expand All @@ -171,13 +171,12 @@ E.g. a key defined on a task, will override the same key defined on a challenge.
indices
.......

The ``indices`` section contains a list of all indices that are used by this track. By default Rally will assume that it can destroy and create these indices at will.
The ``indices`` section contains a list of all indices that are used by this track.

Each index in this list consists of the following properties:

* ``name`` (mandatory): The name of the index.
* ``body`` (optional): File name of the corresponding index definition that will be used as body in the create index API call.
* ``auto-managed`` (optional, defaults to ``true``): Controls whether Rally or the user takes care of creating / destroying the index. If this setting is ``false``, Rally will neither create nor delete this index but just assume its presence.
* ``types`` (optional): A list of type names in this index.

Example::
Expand Down Expand Up @@ -666,7 +665,7 @@ Each challenge consists of the following properties:
* ``name`` (mandatory): A descriptive name of the challenge. Should not contain spaces in order to simplify handling on the command line for users.
* ``description`` (optional): A human readable description of the challenge.
* ``default`` (optional): If true, Rally selects this challenge by default if the user did not specify a challenge on the command line. If your track only defines one challenge, it is implicitly selected as default, otherwise you need define ``"default": true`` on exactly one challenge.
* ``index-settings`` (optional): Defines the index settings of the benchmark candidate when an index is created. Note that these settings are only applied if the index is auto-managed.
* ``index-settings`` (optional): Defines the index settings of the benchmark candidate when an index is created.
* ``schedule`` (mandatory): Defines the concrete execution order of operations. It is described in more detail below.

.. note::
Expand Down
17 changes: 0 additions & 17 deletions esrally/rally.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,13 +316,6 @@ def positive_number(v):
choices=["continue", "abort"],
help="Either 'continue' or 'abort' when Rally gets an error response (default: continue)",
default="continue")
# TODO #380: Remove this. We will turn off index auto management and our standard tracks will provide a track parameter for this.
# This parameter is deprecated. We will replace this with an explicit call in our tracks.
p.add_argument(
"--cluster-health",
choices=["red", "yellow", "green", "skip"],
help="Expected cluster health at the beginning of the benchmark (default: green)",
default="green")
p.add_argument(
"--telemetry",
help="enable the provided telemetry devices, provided as a comma-separated list. List possible telemetry devices "
Expand Down Expand Up @@ -392,12 +385,6 @@ def positive_number(v):
help=argparse.SUPPRESS,
type=lambda s: datetime.datetime.strptime(s, "%Y-%m-%d %H:%M:%S"),
default=None)
# TODO: Remove in Rally 0.10.0 (there will be no index auto-management anymore)
p.add_argument(
"--auto-manage-indices",
choices=["true", "false"],
help=argparse.SUPPRESS,
default=None)
# keeps the cluster running after the benchmark, only relevant if Rally provisions the cluster
p.add_argument(
"--keep-cluster-running",
Expand Down Expand Up @@ -729,7 +716,6 @@ def main():
cfg.add(config.Scope.applicationOverride, "track", "challenge.name", args.challenge)
cfg.add(config.Scope.applicationOverride, "track", "include.tasks", csv_to_list(args.include_tasks))
cfg.add(config.Scope.applicationOverride, "track", "test.mode.enabled", args.test_mode)
cfg.add(config.Scope.applicationOverride, "track", "auto_manage_indices", to_bool(args.auto_manage_indices))

cfg.add(config.Scope.applicationOverride, "reporting", "format", args.report_format)
cfg.add(config.Scope.applicationOverride, "reporting", "values", args.show_in_report)
Expand All @@ -751,9 +737,6 @@ def main():
# other options are stored elsewhere already
cfg.add(config.Scope.applicationOverride, "generator", "node.count", args.node_count)

cfg.add(config.Scope.applicationOverride, "driver", "cluster.health", args.cluster_health)
if args.cluster_health != "green":
console.warn("--cluster-health is deprecated and will be removed in a future version of Rally.")
cfg.add(config.Scope.applicationOverride, "driver", "profiling", args.enable_driver_profiling)
cfg.add(config.Scope.applicationOverride, "driver", "on.error", args.on_error)
cfg.add(config.Scope.applicationOverride, "driver", "load_driver_hosts", csv_to_list(args.load_driver_hosts))
Expand Down
4 changes: 0 additions & 4 deletions esrally/resources/track-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -251,10 +251,6 @@
"type": "string",
"description": "Name of the index to create."
},
"auto-managed": {
"type": "boolean",
"description": "If 'true' then Rally will automatically create / destroy this index. If 'false' users need to ensure that the index exists prior to running the track (optional, defaults to true)."
},
"types": {
"type": "array",
"minItems": 1,
Expand Down
Loading

0 comments on commit 76b29cc

Please sign in to comment.