From f0fe9b45b5c1ce3ed0e9b7a799da9bfc8c9f8e5e Mon Sep 17 00:00:00 2001 From: Natalia Ivakina Date: Thu, 28 Aug 2025 10:34:06 +0200 Subject: [PATCH 1/6] Clarify using of the `ALTER SERVER` options --- modules/ROOT/pages/clustering/servers.adoc | 32 +++++++++++++++++++--- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/modules/ROOT/pages/clustering/servers.adoc b/modules/ROOT/pages/clustering/servers.adoc index 777b8f99d..1d3d55ce1 100644 --- a/modules/ROOT/pages/clustering/servers.adoc +++ b/modules/ROOT/pages/clustering/servers.adoc @@ -426,7 +426,7 @@ Likewise, if `ALTER SERVER '25a7efc7-d063-44b8-bdee-f23357f89f01' SET OPTIONS {a The possible options when altering a server are: -[options="header", width="100%", cols="2a,2,^.^"] +[options="header", width="100%", cols="1a,2,2"] |=== | Option | Allowed values @@ -435,7 +435,7 @@ The possible options when altering a server are: | modeConstraint | `PRIMARY`, `SECONDARY`, `NONE` | Databases may only be hosted on the server in the mode specified by the constraint. -`None` means there is no constraint and any mode is allowed. +`NONE` means there is no constraint and any mode is allowed. | allowedDatabases | list of database names, e.g. `["db1", "db2"]` @@ -459,10 +459,34 @@ This may not be specified in combination with `allowedDatabases`. As with the `DEALLOCATE DATABASES FROM SERVER ...` command, if the alteration of a server's options renders it impossible for the cluster to satisfy one or more of the databases' topologies, then the command fails and no changes are made. -[NOTE] +[IMPORTANT] ==== Input provided to `SET OPTIONS {...}` replaces **all** existing options, rather than being combined with them. -For instance if `SET OPTIONS {modeConstraint:'SECONDARY'}` is executed followed by `SET OPTIONS {allowedDatabases:['foo']}`, the execution of the second `ALTER` removes the mode constraint. + +Any previously set values must be specified every time you run the `ALTER SERVER` command; otherwise they will be overwritten to defaults. + +For instance, first you run the statement: + +[source,cypher] +---- +ALTER SERVER '25a7efc7-d063-44b8-bdee-f23357f89f01' SET OPTIONS {modeConstraint:'SECONDARY'}; +---- + +Later you run: + +[source,cypher] +---- +ALTER SERVER '25a7efc7-d063-44b8-bdee-f23357f89f01' SET OPTIONS {allowedDatabases:['foo']}; +---- + +The execution of the second `ALTER SERVER` removes the mode constraint `SECONDARY`. + +If you want to keep both values `modeConstraint:'SECONDARY'` and `allowedDatabases:['foo']`, you have to explicitly set them in the options for the `ALTER SERVER` command: + +[source,cypher] +---- +ALTER SERVER '25a7efc7-d063-44b8-bdee-f23357f89f01' SET OPTIONS {modeConstraint:'SECONDARY', allowedDatabases:['foo']}; +---- ==== === Renaming a server From 4c47c6c4fb2c4c5409b6a0563cae5673f9dae215 Mon Sep 17 00:00:00 2001 From: Natalia Ivakina <82437520+NataliaIvakina@users.noreply.github.com> Date: Fri, 29 Aug 2025 11:14:20 +0200 Subject: [PATCH 2/6] Update modules/ROOT/pages/clustering/servers.adoc --- modules/ROOT/pages/clustering/servers.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ROOT/pages/clustering/servers.adoc b/modules/ROOT/pages/clustering/servers.adoc index 1d3d55ce1..90c3ba3fe 100644 --- a/modules/ROOT/pages/clustering/servers.adoc +++ b/modules/ROOT/pages/clustering/servers.adoc @@ -463,7 +463,7 @@ As with the `DEALLOCATE DATABASES FROM SERVER ...` command, if the alteration of ==== Input provided to `SET OPTIONS {...}` replaces **all** existing options, rather than being combined with them. -Any previously set values must be specified every time you run the `ALTER SERVER` command; otherwise they will be overwritten to defaults. +Any previously set values must be specified every time you run the `ALTER SERVER` command; otherwise they will be overwritten to defaults taken from the settings `initial.server.mode_constraint`, `initial.server.allowed_databases`, `initial.server.denied_databases`, and/or `initial.server.tags`. For instance, first you run the statement: From 4bdffd3a9b857c2b456db1454011933891062a6e Mon Sep 17 00:00:00 2001 From: Natalia Ivakina <82437520+NataliaIvakina@users.noreply.github.com> Date: Fri, 29 Aug 2025 16:09:50 +0200 Subject: [PATCH 3/6] Update servers.adoc --- modules/ROOT/pages/clustering/servers.adoc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/modules/ROOT/pages/clustering/servers.adoc b/modules/ROOT/pages/clustering/servers.adoc index 90c3ba3fe..e4f08bf4b 100644 --- a/modules/ROOT/pages/clustering/servers.adoc +++ b/modules/ROOT/pages/clustering/servers.adoc @@ -465,15 +465,13 @@ Input provided to `SET OPTIONS {...}` replaces **all** existing options, rather Any previously set values must be specified every time you run the `ALTER SERVER` command; otherwise they will be overwritten to defaults taken from the settings `initial.server.mode_constraint`, `initial.server.allowed_databases`, `initial.server.denied_databases`, and/or `initial.server.tags`. -For instance, first you run the statement: +For instance, you run two statements one after the other: [source,cypher] ---- ALTER SERVER '25a7efc7-d063-44b8-bdee-f23357f89f01' SET OPTIONS {modeConstraint:'SECONDARY'}; ---- -Later you run: - [source,cypher] ---- ALTER SERVER '25a7efc7-d063-44b8-bdee-f23357f89f01' SET OPTIONS {allowedDatabases:['foo']}; From eda1999c7339a8a14f512732acec056f84a07369 Mon Sep 17 00:00:00 2001 From: Natalia Ivakina <82437520+NataliaIvakina@users.noreply.github.com> Date: Thu, 4 Sep 2025 17:29:09 +0200 Subject: [PATCH 4/6] Update servers.adoc --- modules/ROOT/pages/clustering/servers.adoc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/ROOT/pages/clustering/servers.adoc b/modules/ROOT/pages/clustering/servers.adoc index e4f08bf4b..14e73ef98 100644 --- a/modules/ROOT/pages/clustering/servers.adoc +++ b/modules/ROOT/pages/clustering/servers.adoc @@ -485,6 +485,8 @@ If you want to keep both values `modeConstraint:'SECONDARY'` and `allowedDatabas ---- ALTER SERVER '25a7efc7-d063-44b8-bdee-f23357f89f01' SET OPTIONS {modeConstraint:'SECONDARY', allowedDatabases:['foo']}; ---- + +Always check the current configuration with `SHOW SERVERS YIELD *` and reapply unchanged options when using `ALTER SERVER`. ==== === Renaming a server From b05a9dfc6c9aeb6db1a380aa7e2f7ac5367edfc6 Mon Sep 17 00:00:00 2001 From: Natalia Ivakina <82437520+NataliaIvakina@users.noreply.github.com> Date: Fri, 5 Sep 2025 15:25:11 +0200 Subject: [PATCH 5/6] Update modules/ROOT/pages/clustering/servers.adoc Co-authored-by: Nick Giles <100630647+nick-giles-neo@users.noreply.github.com> --- modules/ROOT/pages/clustering/servers.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ROOT/pages/clustering/servers.adoc b/modules/ROOT/pages/clustering/servers.adoc index 14e73ef98..e9b4ca2de 100644 --- a/modules/ROOT/pages/clustering/servers.adoc +++ b/modules/ROOT/pages/clustering/servers.adoc @@ -463,7 +463,7 @@ As with the `DEALLOCATE DATABASES FROM SERVER ...` command, if the alteration of ==== Input provided to `SET OPTIONS {...}` replaces **all** existing options, rather than being combined with them. -Any previously set values must be specified every time you run the `ALTER SERVER` command; otherwise they will be overwritten to defaults taken from the settings `initial.server.mode_constraint`, `initial.server.allowed_databases`, `initial.server.denied_databases`, and/or `initial.server.tags`. +Any previously set values must be specified every time you run the `ALTER SERVER` command; otherwise they will be overwritten to the unset values. For instance, you run two statements one after the other: From 7478b70365f889ea19915b3449f990d04cf84530 Mon Sep 17 00:00:00 2001 From: Natalia Ivakina <82437520+NataliaIvakina@users.noreply.github.com> Date: Mon, 8 Sep 2025 13:47:15 +0200 Subject: [PATCH 6/6] Update modules/ROOT/pages/clustering/servers.adoc --- modules/ROOT/pages/clustering/servers.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ROOT/pages/clustering/servers.adoc b/modules/ROOT/pages/clustering/servers.adoc index e9b4ca2de..a1bff245d 100644 --- a/modules/ROOT/pages/clustering/servers.adoc +++ b/modules/ROOT/pages/clustering/servers.adoc @@ -477,7 +477,7 @@ ALTER SERVER '25a7efc7-d063-44b8-bdee-f23357f89f01' SET OPTIONS {modeConstraint: ALTER SERVER '25a7efc7-d063-44b8-bdee-f23357f89f01' SET OPTIONS {allowedDatabases:['foo']}; ---- -The execution of the second `ALTER SERVER` removes the mode constraint `SECONDARY`. +The execution of the second `ALTER SERVER` removes the mode constraint `SECONDARY`, replacing it with `NONE`. If you want to keep both values `modeConstraint:'SECONDARY'` and `allowedDatabases:['foo']`, you have to explicitly set them in the options for the `ALTER SERVER` command: