Skip to content

Add support for multi-clusters.#2087

Merged
gareth-ellis merged 33 commits into
elastic:masterfrom
gareth-ellis:multi-clusters
Jun 18, 2026
Merged

Add support for multi-clusters.#2087
gareth-ellis merged 33 commits into
elastic:masterfrom
gareth-ellis:multi-clusters

Conversation

@gareth-ellis

Copy link
Copy Markdown
Member

This adds support for a single rally load driver to be able to run benchmarks against multiple Elasticsearch clusters at the same time. This differs than the current behaviour of providing a list of hosts, or a list of clusters where requests are either spread out across the hosts, or a track has to cater specifically for the multiple clusters.

@gareth-ellis

Copy link
Copy Markdown
Member Author

@copilot resolve the merge conflicts in this pull request

@gareth-ellis gareth-ellis marked this pull request as ready for review May 11, 2026 12:13
@gareth-ellis gareth-ellis requested a review from a team as a code owner May 11, 2026 12:13
Copilot AI review requested due to automatic review settings May 11, 2026 12:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request introduces a new multi-cluster pipeline intended to let a single Rally load driver benchmark against multiple Elasticsearch clusters during the same benchmark run, and extends metrics/reporting to surface per-cluster request metrics.

Changes:

  • Adds a new multi-cluster pipeline and CLI/docs guidance for configuring multiple named clusters via --target-hosts / --client-options.
  • Updates the driver and metrics pipeline to tag/request metrics per cluster and report them in a multi-column summary table.
  • Extends option parsing utilities to better support “no default cluster key” scenarios and adds related tests.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
tests/utils/opts_test.py Adds tests for single-cluster wrappers over multi-cluster host/option configs.
tests/racecontrol_test.py Adds pipeline listing expectation and tests for multi-cluster pipeline validation/behavior.
esrally/utils/opts.py Adds ClientOptions.default fallback behavior and single-cluster wrapper classes.
esrally/tracker/tracker.py Chooses a “default or first cluster” host/options when generating tracks.
esrally/reporter.py Adds multi-cluster summary table rendering for per-cluster op metrics.
esrally/rally.py Updates --target-hosts help text to document multi-cluster JSON format.
esrally/racecontrol.py Adds multi-cluster pipeline and adjusts Docker pipeline restrictions + result calculation call signature.
esrally/metrics.py Adds cluster_name filtering support in metrics store APIs and returns per-cluster GlobalStats lists.
esrally/mechanic/mechanic.py Uses “default or first cluster” host selection for engine startup.
esrally/driver/driver.py Adds multi-cluster execution mode (runs each step against each cluster), and tags samples with cluster name.
docs/pipelines.rst Documents the new multi-cluster pipeline and adds it to the pipeline list.
docs/command_line_reference.rst Mentions the multi-cluster pipeline in --target-hosts documentation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread esrally/driver/driver.py Outdated
Comment thread esrally/driver/driver.py
Comment thread esrally/metrics.py Outdated
Comment thread esrally/racecontrol.py Outdated
Comment thread esrally/racecontrol.py Outdated
Comment thread tests/racecontrol_test.py Outdated
Comment thread docs/pipelines.rst Outdated
Comment thread docs/pipelines.rst Outdated
Comment thread docs/command_line_reference.rst Outdated
gareth-ellis and others added 2 commits May 11, 2026 14:26
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@gareth-ellis

Copy link
Copy Markdown
Member Author

@copilot resolve the merge conflicts in this pull request

@pquentin pquentin removed the request for review from a team May 28, 2026 13:48
@pquentin

Copy link
Copy Markdown
Member

Removing es-perf review request as there are still Copilot comments open.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.

Comment thread esrally/driver/driver.py Outdated
Comment thread esrally/driver/driver.py Outdated
Comment thread esrally/reporter.py Outdated
gareth-ellis and others added 4 commits May 29, 2026 08:49
…e name

In calculate_results(), only enter the multi-cluster result path when
race.pipeline == "multi-cluster", rather than inferring it from the
presence of cluster names in the metrics store alone.

This prevents existing multi-cluster --target-hosts setups that use
custom runners (without the multi-cluster pipeline) from accidentally
producing multi-cluster reporting.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated no new comments.

@gareth-ellis gareth-ellis requested a review from a team May 29, 2026 09:54

@gbanasiak gbanasiak left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding this. I left comments after the first code pass. I haven't tested this yet.

Comment thread docs/pipelines.rst
Comment thread docs/command_line_reference.rst Outdated
Comment thread docs/command_line_reference.rst Outdated
Comment thread docs/pipelines.rst Outdated
Comment thread esrally/racecontrol.py Outdated
Comment thread esrally/driver/driver.py Outdated
Comment thread esrally/driver/driver.py
Comment thread esrally/driver/driver.py Outdated
Comment thread esrally/driver/driver.py
Comment thread esrally/metrics.py

@gbanasiak gbanasiak left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good in testing. I've left a few additional minor comments while going through the code after recent modifications.

Comment thread docs/race.rst Outdated
Comment thread esrally/rally.py Outdated
Comment thread esrally/driver/driver.py Outdated

@gbanasiak gbanasiak left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many thanks for all the iterations, LGTM. I left non-blocking comments.

I have also noticed esrally compare does not handle multi-cluster results properly. Something to work on in a follow-up.

Comment thread esrally/tracker/tracker.py Outdated
Comment thread esrally/mechanic/mechanic.py Outdated
Comment thread esrally/driver/driver.py
Comment on lines +593 to +595
@property
def default(self):
return self._clients.get("default") or next(iter(self._clients.values()), None)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: default_or_first method name would be more consistent with ClientOptions class

gareth-ellis and others added 2 commits June 16, 2026 15:49
Co-authored-by: Grzegorz Banasiak <grzegorz.banasiak@elastic.co>
@gareth-ellis gareth-ellis merged commit 05188e9 into elastic:master Jun 18, 2026
15 checks passed
@gareth-ellis gareth-ellis deleted the multi-clusters branch June 18, 2026 12:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants