From a193104ee1e7b2cd6f0d4fcf09a7da46bc6df235 Mon Sep 17 00:00:00 2001 From: Alexander Presnyakov Date: Fri, 18 Jul 2025 02:38:52 +0000 Subject: [PATCH] Added --coordinator-only option to "mcs cluster node add" --- cmapi/cmapi_server/node_manipulation.py | 2 +- cmapi/mcs_cluster_tool/cluster_app.py | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/cmapi/cmapi_server/node_manipulation.py b/cmapi/cmapi_server/node_manipulation.py index 2fde1ff29..49023466a 100644 --- a/cmapi/cmapi_server/node_manipulation.py +++ b/cmapi/cmapi_server/node_manipulation.py @@ -1023,7 +1023,7 @@ def _add_WES(root, pm_num, node): def _add_read_only_node(root: etree.Element, node: str, add_other_nodes_dbroots: bool = True) -> None: - '''Add node name to ReadOnlyNodes if it is not already there, with attribute''' + '''Add node name to ReadOnlyNodes if it is not already there, also set attribute add_other_nodes_dbroots in the tag''' read_only_nodes = root.find('./ReadOnlyNodes') if read_only_nodes is None: read_only_nodes = etree.SubElement(root, 'ReadOnlyNodes') diff --git a/cmapi/mcs_cluster_tool/cluster_app.py b/cmapi/mcs_cluster_tool/cluster_app.py index 9b0f37a6f..0b261d6d2 100644 --- a/cmapi/mcs_cluster_tool/cluster_app.py +++ b/cmapi/mcs_cluster_tool/cluster_app.py @@ -206,6 +206,14 @@ def add( 'Add node (or nodes, if more than one is passed) in read-only ' 'mode.' ) + ), + coordinator_only: bool = typer.Option( + False, + '--coordinator-only', + help=( + 'Add node(s) as coordinator-only (read-only, but does not add other nodes\' dbroots).' + ), + hidden=True, ) ): """Add nodes to the Columnstore cluster.""" @@ -214,9 +222,10 @@ def add( timeout=timedelta(days=1).total_seconds(), handle_signals=True, extra_nodes=nodes ): + add_other_nodes_dbroots = not coordinator_only for node in nodes: result.append( - client.add_node({'node': node, 'read_only': read_only}) + client.add_node({'node': node, 'read_only': read_only, 'add_other_nodes_dbroots': add_other_nodes_dbroots}) ) return result