This is an automated email from the ASF dual-hosted git repository.

epugh pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/solr-orbit.git


The following commit(s) were added to refs/heads/main by this push:
     new 5ba6498f Add --allow-unsuported-user-managed (modeled on bin/solr 
start --user-managed) param (#49)
5ba6498f is described below

commit 5ba6498fc7522284e17a8f5b7e4d1c2b987c7e6d
Author: Eric Pugh <[email protected]>
AuthorDate: Sun Jun 21 16:29:43 2026 -0400

    Add --allow-unsuported-user-managed (modeled on bin/solr start 
--user-managed) param (#49)
---
 docs/reference/commands/command-flags.md           |  1 +
 .../working-with-workloads/running-workloads.md    |  2 +-
 solrorbit/benchmark.py                             |  9 ++++++++
 solrorbit/test_run_orchestrator.py                 |  7 +++++++
 tests/test_execution_orchestrator_test.py          | 24 ++++++++++++++++++++++
 5 files changed, 42 insertions(+), 1 deletion(-)

diff --git a/docs/reference/commands/command-flags.md 
b/docs/reference/commands/command-flags.md
index 9aea448c..9631f9a2 100644
--- a/docs/reference/commands/command-flags.md
+++ b/docs/reference/commands/command-flags.md
@@ -88,6 +88,7 @@ Accepted by all subcommands.
 | `--on-error` | string | `continue` | Error strategy: `continue` or `abort` |
 | `--client-options` | string | `timeout:60` | Comma-separated client options 
passed to the Solr client (short: `-c`) |
 | `--kill-running-processes` | flag | off | Kill other running `solr-orbit` 
processes before starting (short: `-k`) |
+| `--allow-unsupported-user-managed` | flag | off | Skip the SolrCloud-mode 
requirement check and run against a user-managed (non-cloud) target anyway (use 
very much at your own risk) |
 | `--preserve-install` | flag | off | Keep the Solr installation after the run 
(provisioned pipelines only) |
 
 ### Provisioning
diff --git a/docs/user-guide/working-with-workloads/running-workloads.md 
b/docs/user-guide/working-with-workloads/running-workloads.md
index 3af8fd33..9f6ffce0 100644
--- a/docs/user-guide/working-with-workloads/running-workloads.md
+++ b/docs/user-guide/working-with-workloads/running-workloads.md
@@ -30,7 +30,7 @@ solr-orbit run [--pipeline PIPELINE] [--target-hosts HOSTS] \
 ```
 
 {: .important }
-When using the `benchmark-only` pipeline, the target Solr cluster must be 
running in **SolrCloud (ZooKeeper) mode** — standalone/user-managed mode is not 
supported. For Solr 9.x, start Solr with the `-c` flag (e.g. `bin/solr start 
-c` or `docker run -d -p 8983:8983 solr:9 -c`). For Solr 10.0.0 and later, 
SolrCloud is the default.
+When using the `benchmark-only` pipeline, the target Solr cluster must be 
running in **SolrCloud (ZooKeeper) mode** — standalone/user-managed mode is not 
supported. For Solr 9.x, start Solr with the `-c` flag (e.g. `bin/solr start 
-c` or `docker run -d -p 8983:8983 solr:9 -c`). For Solr 10.0.0 and later, 
SolrCloud is the default. To bypass this check and run against a user-managed 
(non-cloud) target anyway, pass `--allow-unsupported-user-managed` (use at your 
own risk; many operations an [...]
 
 ---
 
diff --git a/solrorbit/benchmark.py b/solrorbit/benchmark.py
index 574991e3..24ea5ab4 100644
--- a/solrorbit/benchmark.py
+++ b/solrorbit/benchmark.py
@@ -701,6 +701,14 @@ def create_arg_parser():
         default=False,
         help="If any processes is running, it is going to kill them and allow 
solr-orbit to continue to run."
     )
+    test_run_parser.add_argument(
+        "--allow-unsupported-user-managed",
+        action="store_true",
+        default=False,
+        help="Skip the SolrCloud mode requirement check and run against a 
user-managed "
+             "(non-cloud) target anyway (default: false). Use at your own 
risk; many operations only "
+             "work in SolrCloud mode."
+    )
     test_run_parser.add_argument(
         "--latency-percentiles",
         help=f"A comma-separated list of percentiles to report for latency "
@@ -1155,6 +1163,7 @@ def configure_test(arg_parser, args, cfg):
         "worker_coordinator",
         "worker_ips",
         opts.csv_to_list(args.worker_ips))
+    cfg.add(config.Scope.applicationOverride, "solr", "allow.user.managed", 
args.allow_user_managed)
     cfg.add(config.Scope.applicationOverride, "workload", "test.mode.enabled", 
args.test_mode)
     cfg.add(config.Scope.applicationOverride, "workload", "load.test.clients", 
int(args.load_test_qps))
     if args.redline_test:
diff --git a/solrorbit/test_run_orchestrator.py 
b/solrorbit/test_run_orchestrator.py
index 9b6f02c0..c579a744 100644
--- a/solrorbit/test_run_orchestrator.py
+++ b/solrorbit/test_run_orchestrator.py
@@ -381,6 +381,13 @@ def _check_cloud_mode(cfg):
     """Fail fast with a clear error if the target Solr cluster is not in 
SolrCloud mode."""
     from solrorbit.client import SolrAdminClient, SolrClientError  # local 
import to avoid circular
 
+    if cfg.opts("solr", "allow.user.managed", mandatory=False, 
default_value=False):
+        logging.getLogger(__name__).warning(
+            "Skipping SolrCloud-mode requirement check 
(--allow-unsupported-user-managed). "
+            "Some operations may fail if the target is not in SolrCloud mode."
+        )
+        return
+
     configured_hosts = cfg.opts("client", "hosts")
     hosts = configured_hosts.default
     if not hosts:
diff --git a/tests/test_execution_orchestrator_test.py 
b/tests/test_execution_orchestrator_test.py
index 81360ef3..5c86a5e3 100644
--- a/tests/test_execution_orchestrator_test.py
+++ b/tests/test_execution_orchestrator_test.py
@@ -32,6 +32,7 @@ import unittest.mock as mock
 import pytest
 
 from solrorbit import config, exceptions, test_run_orchestrator
+from solrorbit.utils import opts
 
 
 @pytest.fixture
@@ -127,3 +128,26 @@ def test_runs_a_default_pipeline(benchmark_only_pipeline):
     test_run_orchestrator.run(cfg)
 
     benchmark_only_pipeline.target.assert_called_once_with(cfg)
+
+
+def test_check_cloud_mode_skipped_when_allow_user_managed():
+    # --allow-unsupported-user-managed must bypass the check entirely, without 
touching the network
+    cfg = config.Config()
+    cfg.add(config.Scope.benchmark, "client", "hosts", ["localhost:8983"])
+    cfg.add(config.Scope.benchmark, "solr", "allow.user.managed", True)
+
+    with mock.patch("solrorbit.client.SolrAdminClient") as admin_client:
+        test_run_orchestrator._check_cloud_mode(cfg)
+
+    admin_client.assert_not_called()
+
+
+def test_check_cloud_mode_raises_for_standalone_solr():
+    cfg = config.Config()
+    cfg.add(config.Scope.benchmark, "client", "hosts", 
opts.TargetHosts("localhost:8983"))
+    cfg.add(config.Scope.benchmark, "solr", "allow.user.managed", False)
+
+    with mock.patch("solrorbit.client.SolrAdminClient") as admin_client:
+        admin_client.return_value.is_cloud_mode.return_value = False
+        with pytest.raises(exceptions.SystemSetupError, match="not running in 
SolrCloud"):
+            test_run_orchestrator._check_cloud_mode(cfg)

Reply via email to