Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: NataliaIvakina <[email protected]>
  • Loading branch information
Frannie-Ludmilla and NataliaIvakina authored Dec 20, 2024
1 parent 7bfe5e3 commit d062f01
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,26 +162,26 @@ It produces a database dump that can be further examined and potentially repaire

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.
Meaning, it is not possible to restart it with a simple `START DATABASE` command.
You have to execute `CALL dbms.unquarantineDatabase(server, databaseName, operation)` in order to lift the quarantine, specifying as `server` the instance with the failing database.
You have to run `CALL dbms.unquarantineDatabase(server, database, operation)` to lift the quarantine, specifying as `server` the instance with the failing database.

The `dbms.unquarantineDatabase()` procedure is introduced in Neo4j 2025.01 to replace the now-deprecated xref:procedures.adoc#procedure_dbms_quarantineDatabase[`dbms.quarantineDatabase`()].

After lifting the quarantine, the instance will automatically try to bring the database to the desired state.

*Syntax:*

`CALL dbms.unquarantineDatabase(server, databaseName, operation)`
`CALL dbms.unquarantineDatabase(server, database, operation)`

*Arguments:*
*Input arguments:*

[options="header"]
|===
| Name | Type | Description
| `server` | String | The identifier of the server where the quarantine for database will be lifted.
| `databaseName` | String | The name of the database that will be put into or removed from quarantine.
| `database` | String | The name of the database that will be put into or removed from quarantine.
| `operation` | String | Optional operation to apply while lifting the quarantine.
|===

[NOTE]
====
The possible values for the optional operation are:

* `keepStateKeepStore` -- do nothing; leave store and cluster state as they are.
Expand All @@ -193,16 +193,11 @@ but this joining can succeed if and only if there is a majority of old members "
Let's assume our cluster has a topology with three primaries.
If there is only one server in `QUARANTINED` mode, then it is safe to choose `replaceStateKeepStore` or `replaceStateReplaceStore`.
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.
====

*Returns:*
*Return arguments:*

The procedure doesn't return any value.

[NOTE]
====
The `dbms.unquarantineDatabase` procedure replaces xref:procedures.adoc#procedure_dbms_quarantineDatabase[`dbms.quarantineDatabase`], which has been deprecated in Neo4j 5.26.
====

.Check if a database is quarantined
[source, cypher]
Expand All @@ -226,7 +221,7 @@ neo4j@system> SHOW DATABASE foo;
====
A `quarantined` state is persisted for user databases.
This means that if a database is quarantined, it will remain so even if that Neo4j instance is restarted.
You can remove it only by running the xref:procedures.adoc#procedure_dbms_unquarantineDatabase[`dbms.unquarantineDatabase`] procedure.
You can remove it only by running the xref:procedures.adoc#procedure_dbms_unquarantineDatabase[`dbms.unquarantineDatabase()`] procedure.
The one exception to this rule is for the built-in `system` database.
Any quarantine for that database is removed automatically after instance restart.
Expand Down
2 changes: 1 addition & 1 deletion modules/ROOT/pages/procedures.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1093,7 +1093,7 @@ The deprecated `dbms.quarantineDatabase()` procedure is available in Cypher 5, b
| *Description* 3+a| Lift quarantine from a database on a given server.
.4+| *Input arguments* | *Name* | *Type* | *Description*
| `server` | `STRING` | The identifier of the server where the quarantine for database will be lifted.
| `databaseName` | `STRING` | The name of the database for the quarantine will be lifted.
| `database` | `STRING` | The name of the database for the quarantine will be lifted.
| `operation` | `STRING` | Optional operation to apply while lifting the quarantine.
| *Mode* 3+| DBMS
|===
Expand Down

0 comments on commit d062f01

Please sign in to comment.