Skip to content

Commit c34844c

Browse files
Add CordonedServersExistedDuringAllocation notification (#86) (#99)
https://trello.com/c/1ymz1Qiq/975-create-a-notification-when-doing-allocations-while-some-servers-are-cordoned This PR proposes the introduction of the `CordonedServersExistedDuringAllocation` notification. This will be returned whenever a command that triggers a database allocation decision is executed. This includes `CREATE DATABASE`, `ALTER DATABASE`, `DEALLOCATE DATABASES FROM SERVER`, `ALTER SERVER`. But not `REALLOCATE DATABASES` as this command has the requirement for no cordoned servers and errors if there is such a server. This is useful to remind the person managing the cluster that some servers are cordoned and this impacts the allocation decision (databases can't be allocated to cordoned servers). So this should help the user not get confused by the allocation decisions made. I have included this as a `WARNING` initially but maybe `INFORMATION` would be better suited, not sure on the criteria to be made a `WARNING`. Cordoned servers aren't necessarily a bad thing in themselves but their existence could lead to "worse" allocation decision than if they were uncordoned. So, the warning could be seen as a prompt the user to do something about the cordoned server. Co-authored-by: Jack Waudby <[email protected]>
1 parent cb969c3 commit c34844c

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

modules/ROOT/pages/changelogs.adoc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
:description: This page lists all changes to status codes per Neo4j version.
22
= Changes to status codes per Neo4j version
33

4+
== Neo4j 5.15
5+
6+
**New:**
7+
8+
[source, status codes, role="noheader"]
9+
-----
10+
Neo.ClientNotification.Cluster.CordonedServersExistedDuringAllocation
11+
-----
12+
413
== Neo4j 5.14
514

615
**New:**

modules/ROOT/pages/notifications/all-notifications.adoc

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1233,6 +1233,44 @@ Use `DATABASE *` without the parameter to revoke the privilege on all databases.
12331233

12341234
Topology notifications provide additional information related to managing databases and servers.
12351235

1236+
[#_neo_clientnotification_cluster_cordonedserversexistedduringallocation]
1237+
=== CordonedServersExistedDuringAllocation
1238+
1239+
.When is this notification returned?
1240+
[TIP]
1241+
====
1242+
When a Cypher administration command triggers an allocation decision and some of the servers are cordoned.
1243+
For example, `CREATE DATABASE`, `ALTER DATABASE`, `DEALLOCATE DATABASES FROM SERVER[S]`, and `ALTER DATABASE` return this notification. However, `REALLOCATE DATABASES` requires that there are no cordoned servers and, therefore, does not return it.
1244+
====
1245+
1246+
.Notification details
1247+
[cols="<1s,<4"]
1248+
|===
1249+
|Code
1250+
m|Neo.ClientNotification.Cluster.CordonedServersExistedDuringAllocation
1251+
|Title
1252+
a| Cordoned servers existed when making an allocation decision.
1253+
|Severity
1254+
m|INFORMATION
1255+
|Category
1256+
m|TOPOLOGY
1257+
|===
1258+
1259+
.Cordoned servers existed during an allocation decision
1260+
====
1261+
The example assumes that you have a cluster with three servers, of which server `123e4567-e89b-12d3-a456-426614174000` is cordoned using the `dbms.cluster.cordonServer` procedure. Then the below command will return this notification.
1262+
1263+
Command::
1264+
+
1265+
[source, cypher]
1266+
----
1267+
CREATE DATABASE foo TOPOLOGY 2 PRIMARIES
1268+
----
1269+
1270+
Description of the returned code::
1271+
Server(s) `123e4567-e89b-12d3-a456-426614174000` are cordoned. This can impact allocation decisions.
1272+
====
1273+
12361274
[#_neo_clientnotification_cluster_nodatabasesreallocated]
12371275
=== NoDatabasesReallocated
12381276

0 commit comments

Comments
 (0)