You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-30 19:23:07 +03:00
Added --coordinator-only option to "mcs cluster node add"
This commit is contained in:
@ -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')
|
||||
|
@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user