diff --git a/esrally/mechanic/supplier.py b/esrally/mechanic/supplier.py
index fa001711..a59d640f 100644
--- a/esrally/mechanic/supplier.py
+++ b/esrally/mechanic/supplier.py
@@ -293,8 +293,8 @@ class ElasticsearchDistributionSupplier:
 
     def fetch(self):
         io.ensure_dir(self.distributions_root)
-        distribution_path = "%s/elasticsearch-%s.tar.gz" % (self.distributions_root, self.version)
         download_url = self.repo.download_url
+        distribution_path = os.path.join(self.distributions_root, self.repo.file_name)
         self.logger.info("Resolved download URL [%s] for version [%s]", download_url, self.version)
         if not os.path.isfile(distribution_path) or not self.repo.cache:
             try:
@@ -487,6 +487,11 @@ class DistributionRepository:
         override_key = "{}.url".format(self.name)
         return self._url_for(override_key, default_key)
 
+    @property
+    def file_name(self):
+        url = self.download_url
+        return url[url.rfind("/") + 1:]
+
     def plugin_download_url(self, plugin_name):
         # team repo
         default_key = "plugin_{}_{}_url".format(plugin_name, self.name)

Rally cannot differentiate between default and OSS distribution after download
**Rally version** (get with `esrally --version`): all versions

**Description of the problem including expected versus actual behavior**:

When we run a benchmark first with the OSS distribution and then one with the default one, Rally raises the following error:

```
FileNotFoundError: [Errno 2] No such file or directory: '/home/user/.rally/benchmarks/races/2018-06-18-05-44-23/rally-node-0/install/elasticsearch-6.3.0/bin/elasticsearch-certgen'
```

**Steps to reproduce**:

1. Ensure that `~/.rally/benchmarks/distributions/` is empty

2. Run one benchmark with the OSS distribution:

```
esrally --test-mode --distribution-version=6.3.0 --car="defaults"
```

3. Run one benchmark with the default distribution and enable X-Pack Security:

```
esrally --test-mode --distribution-version=6.3.0 --car="defaults,x-pack-security" --client-options="basic_auth_user:'rally',basic_auth_password:'rally-password',use_ssl:true,verify_certs:false,timeout:60,request_timeout:60"
```
diff --git a/tests/mechanic/supplier_test.py b/tests/mechanic/supplier_test.py
index cbd5dbe6..af16e456 100644
--- a/tests/mechanic/supplier_test.py
+++ b/tests/mechanic/supplier_test.py
@@ -512,6 +512,7 @@ class DistributionRepositoryTests(TestCase):
             "release.cache": "true"
         }, version="5.5.0")
         self.assertEqual("https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.5.0.tar.gz", repo.download_url)
+        self.assertEqual("elasticsearch-5.5.0.tar.gz", repo.file_name)
         self.assertTrue(repo.cache)
 
     def test_release_repo_config_with_user_url(self):
@@ -522,6 +523,7 @@ class DistributionRepositoryTests(TestCase):
             "release.cache": "false"
         }, version="2.4.3")
         self.assertEqual("https://es-mirror.example.org/downloads/elasticsearch/elasticsearch-2.4.3.tar.gz", repo.download_url)
+        self.assertEqual("elasticsearch-2.4.3.tar.gz", repo.file_name)
         self.assertFalse(repo.cache)
 
     def test_missing_url(self):

pip install -e .
parse_log_pytest
pytest
pytest pytest-benchmark
apt-get update apt-get install -y gcc
3.6
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
attrs @ file:///opt/conda/conda-bld/attrs_1642510447205/work
certifi==2021.5.30
elasticsearch==6.2.0
-e git+https://github.com/elastic/rally.git@085e3d482717d88dfc2d41aa34502eb108abbfe9#egg=esrally
importlib-metadata @ file:///tmp/build/80754af9/importlib-metadata_1631916693255/work
iniconfig @ file:///home/linux1/recipes/ci/iniconfig_1610983019677/work
Jinja2==2.9.5
jsonschema==2.5.1
MarkupSafe==2.0.1
more-itertools @ file:///tmp/build/80754af9/more-itertools_1637733554872/work
packaging @ file:///tmp/build/80754af9/packaging_1637314298585/work
pluggy @ file:///tmp/build/80754af9/pluggy_1615976315926/work
psutil==5.4.0
py @ file:///opt/conda/conda-bld/py_1644396412707/work
py-cpuinfo==3.2.0
pyparsing @ file:///tmp/build/80754af9/pyparsing_1635766073266/work
pytest==6.2.4
pytest-benchmark==3.4.1
tabulate==0.8.1
thespian==3.9.2
toml @ file:///tmp/build/80754af9/toml_1616166611790/work
typing_extensions @ file:///opt/conda/conda-bld/typing_extensions_1647553014482/work
urllib3==1.22
zipp @ file:///tmp/build/80754af9/zipp_1633618647012/work

name: rally
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - attrs=21.4.0=pyhd3eb1b0_0
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2021.5.30=py36h06a4308_0
  - importlib-metadata=4.8.1=py36h06a4308_0
  - importlib_metadata=4.8.1=hd3eb1b0_0
  - iniconfig=1.1.1=pyhd3eb1b0_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - more-itertools=8.12.0=pyhd3eb1b0_0
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - packaging=21.3=pyhd3eb1b0_0
  - pip=21.2.2=py36h06a4308_0
  - pluggy=0.13.1=py36h06a4308_0
  - py=1.11.0=pyhd3eb1b0_0
  - pyparsing=3.0.4=pyhd3eb1b0_0
  - pytest=6.2.4=py36h06a4308_2
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - toml=0.10.2=pyhd3eb1b0_0
  - typing_extensions=4.1.1=pyh06a4308_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zipp=3.6.0=pyhd3eb1b0_0
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - elasticsearch==6.2.0
      - jinja2==2.9.5
      - jsonschema==2.5.1
      - markupsafe==2.0.1
      - psutil==5.4.0
      - py-cpuinfo==3.2.0
      - pytest-benchmark==3.4.1
      - tabulate==0.8.1
      - thespian==3.9.2
      - urllib3==1.22
prefix: /opt/conda/envs/rally

tests/mechanic/supplier_test.py::DistributionRepositoryTests::test_release_repo_config_with_default_url tests/mechanic/supplier_test.py::DistributionRepositoryTests::test_release_repo_config_with_user_url
tests/mechanic/supplier_test.py::RevisionExtractorTests::test_invalid_revisions tests/mechanic/supplier_test.py::RevisionExtractorTests::test_multiple_revisions tests/mechanic/supplier_test.py::RevisionExtractorTests::test_single_revision tests/mechanic/supplier_test.py::SourceRepositoryTests::test_checkout_current tests/mechanic/supplier_test.py::SourceRepositoryTests::test_checkout_revision tests/mechanic/supplier_test.py::SourceRepositoryTests::test_checkout_revision_for_local_only_repo tests/mechanic/supplier_test.py::SourceRepositoryTests::test_checkout_ts tests/mechanic/supplier_test.py::SourceRepositoryTests::test_intial_checkout_latest tests/mechanic/supplier_test.py::SourceRepositoryTests::test_is_commit_hash tests/mechanic/supplier_test.py::SourceRepositoryTests::test_is_not_commit_hash tests/mechanic/supplier_test.py::BuilderTests::test_build_on_jdk_10 tests/mechanic/supplier_test.py::BuilderTests::test_build_on_jdk_8 tests/mechanic/supplier_test.py::ElasticsearchSourceSupplierTests::test_add_elasticsearch_binary tests/mechanic/supplier_test.py::ElasticsearchSourceSupplierTests::test_build tests/mechanic/supplier_test.py::ElasticsearchSourceSupplierTests::test_no_build tests/mechanic/supplier_test.py::ElasticsearchSourceSupplierTests::test_raises_error_on_missing_car_variable tests/mechanic/supplier_test.py::ExternalPluginSourceSupplierTests::test_add_binary_built_along_elasticsearch tests/mechanic/supplier_test.py::ExternalPluginSourceSupplierTests::test_along_es_plugin_keeps_build_dir tests/mechanic/supplier_test.py::ExternalPluginSourceSupplierTests::test_invalid_config_duplicate_source tests/mechanic/supplier_test.py::ExternalPluginSourceSupplierTests::test_invalid_config_no_source tests/mechanic/supplier_test.py::ExternalPluginSourceSupplierTests::test_resolve_plugin_binary_built_standalone tests/mechanic/supplier_test.py::ExternalPluginSourceSupplierTests::test_standalone_plugin_overrides_build_dir tests/mechanic/supplier_test.py::CorePluginSourceSupplierTests::test_resolve_plugin_binary tests/mechanic/supplier_test.py::PluginDistributionSupplierTests::test_resolve_plugin_url tests/mechanic/supplier_test.py::CreateSupplierTests::test_create_suppliers_for_es_and_plugin_source_build tests/mechanic/supplier_test.py::CreateSupplierTests::test_create_suppliers_for_es_distribution_plugin_source_build tests/mechanic/supplier_test.py::CreateSupplierTests::test_create_suppliers_for_es_distribution_plugin_source_skip tests/mechanic/supplier_test.py::CreateSupplierTests::test_create_suppliers_for_es_missing_distribution_plugin_source_skip tests/mechanic/supplier_test.py::CreateSupplierTests::test_create_suppliers_for_es_only_config tests/mechanic/supplier_test.py::CreateSupplierTests::test_derive_supply_requirements_es_and_plugin_source_build tests/mechanic/supplier_test.py::CreateSupplierTests::test_derive_supply_requirements_es_distribution tests/mechanic/supplier_test.py::CreateSupplierTests::test_derive_supply_requirements_es_distribution_and_plugin_source_build tests/mechanic/supplier_test.py::CreateSupplierTests::test_derive_supply_requirements_es_distribution_and_plugin_source_skip tests/mechanic/supplier_test.py::CreateSupplierTests::test_derive_supply_requirements_es_source_build tests/mechanic/supplier_test.py::CreateSupplierTests::test_derive_supply_requirements_es_source_skip tests/mechanic/supplier_test.py::DistributionRepositoryTests::test_invalid_cache_value tests/mechanic/supplier_test.py::DistributionRepositoryTests::test_missing_cache tests/mechanic/supplier_test.py::DistributionRepositoryTests::test_missing_plugin_config tests/mechanic/supplier_test.py::DistributionRepositoryTests::test_missing_url tests/mechanic/supplier_test.py::DistributionRepositoryTests::test_plugin_config_with_default_url tests/mechanic/supplier_test.py::DistributionRepositoryTests::test_plugin_config_with_user_url
esrally/mechanic/supplier.py
esrally/mechanic/supplier.py