Skip to content

Commit a37bde6

Browse files
5.x-cherry-pick-1127 (#1130)
Co-authored-by: Jack Waudby <[email protected]>
1 parent c002c53 commit a37bde6

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

modules/ROOT/pages/clustering/databases.adoc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,19 @@ See xref:clustering/databases.adoc#cluster-seed[Seed a cluster] further on for i
6767
Also, it is possible to automatically transition _from_ a topology with a single primary host to multiple primary hosts.
6868
Keep in mind that during such a transition, the database will be unavailable for a short period of time.
6969

70+
`ALTER DATABASE` commands are optionally idempotent, with the default behavior to fail with an error if the database does not exist.
71+
Appending `IF EXISTS` to the command ensures that no error is returned and nothing happens should the database not exist.
72+
73+
If the `ALTER DATABASE` command decreases the number of allocations of a database, allocations on xref:clustering/servers.adoc#_cordoned_servers[cordoned servers] are removed first.
74+
75+
.Query
76+
[source, cypher]
77+
----
78+
ALTER DATABASE nonExisting IF EXISTS SET TOPOLOGY 1 PRIMARY 0 SECONDARY
79+
----
80+
81+
[role="statsonlyqueryresult"]
82+
0 rows
7083
// This part can be added back once it has been implemented.
7184
// The allocation approach can be specified with the setting `initial.dbms.database_allocator`.
7285
// The available options are:

modules/ROOT/pages/clustering/servers.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ Additionally, servers which are deallocating will not have any further databases
4949

5050
The _Cordoned_ state is similar to _Deallocating_ in that servers in this state will not be allocated to host additional databases.
5151
Unlike _Deallocating_ however, cordoned servers do not lose the databases they already host.
52+
It is worth noting that when decreasing the number of allocations of a database, allocations on cordoned servers are removed first.
5253

5354
A server is transitioned from the _Enabled_ state to the _Cordoned_ state by executing the procedure `dbms.cluster.cordonServer`.
5455
A server in the _Cordoned_ state may be transitioned to _Deallocating_, or back to _Enabled_.

0 commit comments

Comments
 (0)