You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add new unquarantine procedure + deprecate quarantine (#1985)
Added docs for brand-new `unquarantineDatabase` procedure and for the
now deprecated `quarantineDatabase` procedure.
---------
Co-authored-by: NataliaIvakina <[email protected]>
Copy file name to clipboardExpand all lines: modules/ROOT/pages/database-administration/standard-databases/errors.adoc
+22-52Lines changed: 22 additions & 52 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -160,74 +160,44 @@ It produces a database dump that can be further examined and potentially repaire
160
160
[[quarantine]]
161
161
== Quarantined databases
162
162
163
-
There are two ways to get a database into a `quarantined` state:
164
-
165
-
* By using the xref:procedures.adoc#procedure_dbms_quarantineDatabase[`dbms.quarantineDatabase`] procedure locally to isolate a specific database.
166
-
The procedure must be executed on the instance whose copy of the database you want to quarantine.
167
-
A reason for that can be, for example, when a database is unable to start on a given instance due to a file system permissions issue with the volume where the database is located or when a recently started database begins to log errors.
168
-
The quarantine state renders the database inaccessible on that instance and prevents its state from being changed, for example, with the `START DATABASE` command.
169
-
+
170
-
[NOTE]
171
-
====
172
-
If running in a cluster, database management commands such as `START DATABASE foo` will still take effect on the instances which have *not* quarantined `foo`.
173
-
====
174
-
175
-
* When a database encounters a severe error during its normal run, which prevents it from a further operation, Neo4j stops that database and brings it into a `quarantined` state.
163
+
When a database encounters a severe error during its normal run, which prevents it from a further operation, Neo4j stops that database and brings it into a `quarantined` state.
176
164
Meaning, it is not possible to restart it with a simple `START DATABASE` command.
177
-
You have to execute `CALL dbms.quarantineDatabase(databaseName, false)` on the instance with the failing database in order to lift the quarantine.
165
+
You have to run `CALL dbms.unquarantineDatabase(server, database, operation)` to lift the quarantine, specifying as `server` the instance with the failing database.
178
166
179
-
After lifting the quarantine, the instance will automatically try to bring the database to the desired state.
167
+
The `dbms.unquarantineDatabase()` procedure is introduced in Neo4j 2025.01 to replace the now-deprecated xref:procedures.adoc#procedure_dbms_quarantineDatabase[`dbms.quarantineDatabase`()].
180
168
181
-
[NOTE]
182
-
====
183
-
It is recommended to run the quarantine procedure over the `bolt://` protocol rather than `neo4j://`, which may route requests to unexpected instances.
184
-
====
169
+
After lifting the quarantine, the instance will automatically try to bring the database to the desired state.
| `databaseName` | String | The name of the database that will be put into or removed from quarantine.
196
-
| `setStatus` | Boolean | `true` for placing the database into quarantine; `false` for lifting the quarantine.
197
-
| `reason` | String | (Optional) The reason for placing the database in quarantine.
180
+
| `server` | String | The identifier of the server where the quarantine for database will be lifted.
181
+
| `database` | String | The name of the database that will be put into or removed from quarantine.
182
+
| `operation` | String | Optional operation to apply while lifting the quarantine.
198
183
|===
199
184
200
-
*Returns:*
185
+
The possible values for the optional operation are:
201
186
202
-
[options="header"]
203
-
|===
204
-
| Name | Type | Description
205
-
| `databaseName` | String | The name of the database.
206
-
| `quarantined` | String | Actual state.
207
-
| `result` | String | Result of the last operation.
208
-
The result contains the user, the time, and the reason for the quarantine.
209
-
|===
187
+
* `keepStateKeepStore` -- do nothing; leave store and cluster state as they are.
188
+
* `replaceStateKeepStore` -- join as a new member, clearing the current cluster state but keeping the store.
189
+
* `replaceStateReplaceStore` -- join as a new member, clearing both the current cluster state and the store.
210
190
211
-
[NOTE]
212
-
====
213
-
The `dbms.quarantineDatabase` procedure replaces xref:procedures.adoc#procedure_dbms_cluster_quarantinedatabase[`dbms.cluster.quarantineDatabase`], which has been deprecated in Neo4j 4.3 and will be removed with the next major version.
214
-
====
191
+
If you choose to clear the current cluster state, the server will try to join as a new member,
192
+
but this joining can succeed if and only if there is a majority of old members "letting" the new members in.
193
+
Let's assume our cluster has a topology with three primaries.
194
+
If there is only one server in `QUARANTINED` mode, then it is safe to choose `replaceStateKeepStore` or `replaceStateReplaceStore`.
195
+
If there are two servers in `QUARANTINED` mode, then you should not use concurrently `replaceStateKeepStore` or `replaceStateReplaceStore` for both servers because there would be no majority to let them in.
3 row available after 100 ms, consumed after another 6 ms
230
-
----
231
201
232
202
.Check if a database is quarantined
233
203
[source, cypher]
@@ -251,7 +221,7 @@ neo4j@system> SHOW DATABASE foo;
251
221
====
252
222
A `quarantined` state is persisted for user databases.
253
223
This means that if a database is quarantined, it will remain so even if that Neo4j instance is restarted.
254
-
You can remove it only by running the xref:procedures.adoc#procedure_dbms_quarantineDatabase[`dbms.quarantineDatabase`] procedure on the instance where the quarantined database is located, passing `false` for the `setStatus` parameter.
224
+
You can remove it only by running the xref:procedures.adoc#procedure_dbms_unquarantineDatabase[`dbms.unquarantineDatabase()`] procedure.
255
225
256
226
The one exception to this rule is for the built-in `system` database.
257
227
Any quarantine for that database is removed automatically after instance restart.
@@ -1076,6 +1076,43 @@ For more information, see the link:{neo4j-docs-base-uri}/cypher-manual/{page-ver
1076
1076
| *Mode* 3+| DBMS
1077
1077
|===
1078
1078
1079
+
[NOTE]
1080
+
====
1081
+
It is recommended to use <<procedure_dbms_unquarantineDatabase,`dbms.unquarantineDatabase()`>> over `dbms.quarantineDatabase()` due to its improvements and new features (see the `operation` option ).
1082
+
// The deprecated `dbms.quarantineDatabase()` procedure is available in Cypher 5, but not in Cypher 25.
| `server` | `STRING` | The identifier of the server where the quarantine for database will be lifted.
1096
+
| `database` | `STRING` | The name of the database for the quarantine will be lifted.
1097
+
| `operation` | `STRING` | Optional operation to apply while lifting the quarantine.
1098
+
| *Mode* 3+| DBMS
1099
+
|===
1100
+
1101
+
[NOTE]
1102
+
====
1103
+
The possible values for the optional operation are:
1104
+
1105
+
* `keepStateKeepStore` -- do nothing; leave store and cluster state as they are.
1106
+
* `replaceStateKeepStore` -- join as a new member, clearing the current cluster state but keeping the store.
1107
+
* `replaceStateReplaceStore` -- join as a new member, clearing both the current cluster state and the store.
1108
+
1109
+
If you choose to clear the current cluster state, the server will try to join as a new member,
1110
+
but this joining can succeed if and only if there is a majority of old members "letting" the new members in.
1111
+
Let's assume our cluster has a topology with three primaries.
1112
+
If there is only one server in `QUARANTINED` mode, then it is safe to choose `replaceStateKeepStore` or `replaceStateReplaceStore`.
1113
+
If there are two servers in `QUARANTINED` mode, then you should not use concurrently `replaceStateKeepStore` or `replaceStateReplaceStore` for both servers because there would be no majority to let them in.
0 commit comments