From 9b407c12a19f9d9a83792c3a37e71fa93e9f45d1 Mon Sep 17 00:00:00 2001 From: Natalia Ivakina Date: Wed, 18 Sep 2024 16:04:12 +0200 Subject: [PATCH 01/11] Add docs on the recreate procedure --- modules/ROOT/pages/clustering/databases.adoc | 103 +++++++++++++++++++ modules/ROOT/pages/clustering/index.adoc | 2 +- 2 files changed, 104 insertions(+), 1 deletion(-) diff --git a/modules/ROOT/pages/clustering/databases.adoc b/modules/ROOT/pages/clustering/databases.adoc index 87ed8f282..01304bea9 100644 --- a/modules/ROOT/pages/clustering/databases.adoc +++ b/modules/ROOT/pages/clustering/databases.adoc @@ -225,6 +225,109 @@ neo4j@neo4j> DRYRUN REALLOCATE DATABASES; +----------------------------------------------------------------------------------------------------------------------------------------+ ---- +[role=label--new-5.24] +[[recreate-databases]] +== Recreate databases using a procedure + +Neo4j 5.24 introduces the xref:reference/procedures.adoc#procedure_dbms_cluster_recreateDatabase[`dbms.cluster.recreateDatabase()`] procedure, which allows you: + +* To restore a database store to a specified backup, while keeping all the users and roles (metadata) for the database. + +* To make a database writable again after it has been lost due to a disaster. +See xref:clustering/disaster-recovery.adoc[] for more information. + +[CAUTION] +==== +The recreate procedure works only for real user databases and not for composite databases, or the `system` database. + +Keep in mind the recreate procedure results in downtime while the stores get updated. +The time is unbounded and may depend on the store size and network speed. + +The recreate procedure selects the most up-to-date seed from the defined seeding servers. +If only a subset of the previous cluster members is specified as seeders, there is a risk of data loss. +To avoid this, ensure you back up the current store before replacing it with a seed from a URI, so the latest state can be restored if needed. +==== + +The database in question can be in an `online` or `offline` state when it is recreated, but a successful operation starts the database regardless of the previous state. + +If CDC is enabled for the database, it will still be enabled after recreating the database, however the chain will be broken. +See link:https://neo4j.com/docs/cdc/current/[CDC documentation] for more details. - general link ?? Do we have any more specific guidelines on the topic? + +Before recreating a database, any eventual quarantined states need to be addressed. +?? For more information, refer to the Quarantined State documentation. ?? + +You need xref:authentication-authorization/dbms-administration.adoc#access-control-dbms-administration-database-management[the DBMS `DATABASE MANAGEMENT` privileges] to run the recreate procedure. + +[[recreate-seeding-options]] +=== Seeding options and configurations + +The store to be used during the recreation can be defined in three different ways. +One method uses a backup, while the two others use available allocations in the cluster. + +Additionally, you have the option to modify <> during the recreation process. +However, note that the store format, access, and enrichment cannot be altered during recreation. + +[[uri-seed]] +==== `seedURI` + +If you provide a URI to a backup or a dump, the stores on all allocations will be replaced by the backup or the dump at the given URI. +The new allocations can be put on any `ENABLED` server in the cluster. +See <> for more details. + +[source, shell, role=nocopy] +---- +CALL dbms.cluster.recreateDatabase("neo4j", {seedURI: "myBackup"}); +---- + +[[seed-servers]] +==== `seedingServers` + +Specify a set of available servers. +The stores on all allocations will be synchronized to the most up-to-date store from the defined servers. +The number of defined servers cannot exceed the number of total allocations in the desired topology. + +[source, shell] +---- +CALL dbms.cluster.recreateDatabase("neo4j", {seedingServers: ["serverId1", "serverId2", "serverId3"]}); +---- + +[[undefined-servers]] +==== Undefined servers + +If you provide an empty list of seeding servers or do not specify a `seedURI`, Neo4j automatically selects all available allocations of the database as seeders. +The store will be replaced by the most up-to-date seeder available in the cluster. + +[source, shell] +---- +CALL dbms.cluster.recreateDatabase("neo4j", {seedingServers: []}); +---- + +[[undefined-servers-backup]] +===== Undefined servers with fallback backup + +If both an empty list of seeding servers and a `seedURI` are provided, the system finds all available allocations of the database and use those as seeders. +However, if no available servers can be found, the database is recreated based on the backup or the dump defined by the URI. +This means the store is replaced by the most up-to-date seeder if available; otherwise, the backup is used. + +[source, shell] +---- +CALL dbms.cluster.recreateDatabase("neo4j", {seedingServers: [], seedURI: "myBackup"}); +---- + +[[alter-topology-recreate]] +=== Change the topology + +There is an option to define a new topology when recreating a database. +This can be beneficial during a disaster, if enough servers are not available to recreate the database with the original topology. +When altering the total number of allocations down during a recreation, it is important to remember that the number of seeding servers cannot exceed the number of total allocations of the database. +This also holds true when using recreate with an empty list of seeders. +If there are more available servers in the cluster hosting the database than the number of new allocations, the recreation will fail. + +[source, shell] +---- +CALL dbms.cluster.recreateDatabase("neo4j", {seedingServers: [], primaries: 3, secondaries: 0}); +---- + [[cluster-seed]] == Seed a cluster diff --git a/modules/ROOT/pages/clustering/index.adoc b/modules/ROOT/pages/clustering/index.adoc index 5e181cdf4..2d56ef214 100644 --- a/modules/ROOT/pages/clustering/index.adoc +++ b/modules/ROOT/pages/clustering/index.adoc @@ -9,7 +9,7 @@ This chapter describes the following: * Setting up a cluster -- The basics of configuring and deploying a new cluster. ** xref:clustering/setup/deploy.adoc[Deploy a basic cluster] -- How to set up a basic cluster. ** xref:clustering/setup/analytics-cluster.adoc[Deploy an analytics cluster] -- How to deploy a special case Neo4j cluster for analytic queries. -** xref:clustering/setup/single-to-cluster.adoc[Move from single server to cluster] -- This section describes how to move from a single Neo4j server to Neo4j cluster. +** xref:clustering/setup/single-to-cluster.adoc[Move from a standalone deployment to a cluster] -- This section describes how to move from a single Neo4j server to Neo4j cluster. ** xref:clustering/setup/discovery.adoc[Cluster server discovery] -- How servers in a cluster discover each other and form a cluster. ** xref:clustering/setup/routing.adoc[Leadership, routing and load balancing] -- Election of leaders, routing and load balancing. ** xref:clustering/setup/encryption.adoc[Intra-cluster encryption] -- How to secure the cluster communication. From f36baa6f3ae7272da1ff18120742646c24b90634 Mon Sep 17 00:00:00 2001 From: NataliaIvakina <82437520+NataliaIvakina@users.noreply.github.com> Date: Wed, 18 Sep 2024 16:09:56 +0200 Subject: [PATCH 02/11] Update modules/ROOT/pages/clustering/databases.adoc --- modules/ROOT/pages/clustering/databases.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ROOT/pages/clustering/databases.adoc b/modules/ROOT/pages/clustering/databases.adoc index 01304bea9..a611dd90c 100644 --- a/modules/ROOT/pages/clustering/databases.adoc +++ b/modules/ROOT/pages/clustering/databases.adoc @@ -233,7 +233,7 @@ Neo4j 5.24 introduces the xref:reference/procedures.adoc#procedure_dbms_cluster_ * To restore a database store to a specified backup, while keeping all the users and roles (metadata) for the database. -* To make a database writable again after it has been lost due to a disaster. +* To restore a database to a write mode again after it has been lost due to a disaster. See xref:clustering/disaster-recovery.adoc[] for more information. [CAUTION] From 30581c9ff20ac167b5adac1bac9ecfceb6ed68b7 Mon Sep 17 00:00:00 2001 From: NataliaIvakina <82437520+NataliaIvakina@users.noreply.github.com> Date: Wed, 18 Sep 2024 17:09:48 +0200 Subject: [PATCH 03/11] Apply suggestions from code review --- modules/ROOT/pages/clustering/databases.adoc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/ROOT/pages/clustering/databases.adoc b/modules/ROOT/pages/clustering/databases.adoc index a611dd90c..c859fe902 100644 --- a/modules/ROOT/pages/clustering/databases.adoc +++ b/modules/ROOT/pages/clustering/databases.adoc @@ -233,7 +233,7 @@ Neo4j 5.24 introduces the xref:reference/procedures.adoc#procedure_dbms_cluster_ * To restore a database store to a specified backup, while keeping all the users and roles (metadata) for the database. -* To restore a database to a write mode again after it has been lost due to a disaster. +* To restore a database to a write mode again after it has been lost (for example, due to a disaster). See xref:clustering/disaster-recovery.adoc[] for more information. [CAUTION] @@ -251,10 +251,10 @@ To avoid this, ensure you back up the current store before replacing it with a s The database in question can be in an `online` or `offline` state when it is recreated, but a successful operation starts the database regardless of the previous state. If CDC is enabled for the database, it will still be enabled after recreating the database, however the chain will be broken. -See link:https://neo4j.com/docs/cdc/current/[CDC documentation] for more details. - general link ?? Do we have any more specific guidelines on the topic? +See link:https://neo4j.com/docs/cdc/current/[CDC documentation] for more details. Before recreating a database, any eventual quarantined states need to be addressed. -?? For more information, refer to the Quarantined State documentation. ?? +For more information, refer to the quarantined state documentation. You need xref:authentication-authorization/dbms-administration.adoc#access-control-dbms-administration-database-management[the DBMS `DATABASE MANAGEMENT` privileges] to run the recreate procedure. From dd08fea4c8bb1cbf067355d28c02bdbff7b1afad Mon Sep 17 00:00:00 2001 From: NataliaIvakina <82437520+NataliaIvakina@users.noreply.github.com> Date: Wed, 18 Sep 2024 17:09:58 +0200 Subject: [PATCH 04/11] Update modules/ROOT/pages/clustering/databases.adoc --- modules/ROOT/pages/clustering/databases.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ROOT/pages/clustering/databases.adoc b/modules/ROOT/pages/clustering/databases.adoc index c859fe902..ea8777db7 100644 --- a/modules/ROOT/pages/clustering/databases.adoc +++ b/modules/ROOT/pages/clustering/databases.adoc @@ -274,7 +274,7 @@ If you provide a URI to a backup or a dump, the stores on all allocations will b The new allocations can be put on any `ENABLED` server in the cluster. See <> for more details. -[source, shell, role=nocopy] +[source, shell] ---- CALL dbms.cluster.recreateDatabase("neo4j", {seedURI: "myBackup"}); ---- From d06c70109b3f1b3cee1a784fa16a4f75d7249626 Mon Sep 17 00:00:00 2001 From: NataliaIvakina <82437520+NataliaIvakina@users.noreply.github.com> Date: Thu, 19 Sep 2024 14:00:18 +0200 Subject: [PATCH 05/11] Apply suggestions from code review Co-authored-by: Balazs Lendvai <56266523+gfx54b@users.noreply.github.com> Co-authored-by: Anna Sjerling <102957391+AnnaSjerling@users.noreply.github.com> --- modules/ROOT/pages/clustering/databases.adoc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/ROOT/pages/clustering/databases.adoc b/modules/ROOT/pages/clustering/databases.adoc index ea8777db7..8273b2e75 100644 --- a/modules/ROOT/pages/clustering/databases.adoc +++ b/modules/ROOT/pages/clustering/databases.adoc @@ -227,11 +227,11 @@ neo4j@neo4j> DRYRUN REALLOCATE DATABASES; [role=label--new-5.24] [[recreate-databases]] -== Recreate databases using a procedure +== Recreate databases Neo4j 5.24 introduces the xref:reference/procedures.adoc#procedure_dbms_cluster_recreateDatabase[`dbms.cluster.recreateDatabase()`] procedure, which allows you: -* To restore a database store to a specified backup, while keeping all the users and roles (metadata) for the database. +* To restore a database to a specified backup, while keeping all the associated privileges for the database. * To restore a database to a write mode again after it has been lost (for example, due to a disaster). See xref:clustering/disaster-recovery.adoc[] for more information. @@ -241,7 +241,7 @@ See xref:clustering/disaster-recovery.adoc[] for more information. The recreate procedure works only for real user databases and not for composite databases, or the `system` database. Keep in mind the recreate procedure results in downtime while the stores get updated. -The time is unbounded and may depend on the store size and network speed. +The time is unbounded and may depend on different factors -- for example, the size of the store, network speed, etc. The recreate procedure selects the most up-to-date seed from the defined seeding servers. If only a subset of the previous cluster members is specified as seeders, there is a risk of data loss. @@ -254,14 +254,14 @@ If CDC is enabled for the database, it will still be enabled after recreating th See link:https://neo4j.com/docs/cdc/current/[CDC documentation] for more details. Before recreating a database, any eventual quarantined states need to be addressed. -For more information, refer to the quarantined state documentation. +For more information, see xref:clustering/databases.adoc#recreate-databases[Standard databases -> Error handling]. You need xref:authentication-authorization/dbms-administration.adoc#access-control-dbms-administration-database-management[the DBMS `DATABASE MANAGEMENT` privileges] to run the recreate procedure. [[recreate-seeding-options]] === Seeding options and configurations -The store to be used during the recreation can be defined in three different ways. +The store to be used during the recreation of a database can be defined in three different ways. One method uses a backup, while the two others use available allocations in the cluster. Additionally, you have the option to modify <> during the recreation process. From cdd418a1135d2a088dd559312975286d779dd00b Mon Sep 17 00:00:00 2001 From: NataliaIvakina <82437520+NataliaIvakina@users.noreply.github.com> Date: Thu, 19 Sep 2024 15:21:18 +0200 Subject: [PATCH 06/11] Apply suggestions from code review --- modules/ROOT/pages/clustering/databases.adoc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/ROOT/pages/clustering/databases.adoc b/modules/ROOT/pages/clustering/databases.adoc index 8273b2e75..9a1eea5cb 100644 --- a/modules/ROOT/pages/clustering/databases.adoc +++ b/modules/ROOT/pages/clustering/databases.adoc @@ -229,12 +229,12 @@ neo4j@neo4j> DRYRUN REALLOCATE DATABASES; [[recreate-databases]] == Recreate databases -Neo4j 5.24 introduces the xref:reference/procedures.adoc#procedure_dbms_cluster_recreateDatabase[`dbms.cluster.recreateDatabase()`] procedure, which allows you: +Neo4j 5.24 introduces the xref:reference/procedures.adoc#procedure_dbms_cluster_recreateDatabase[`dbms.cluster.recreateDatabase()`] procedure, which allows you to restore a database: -* To restore a database to a specified backup, while keeping all the associated privileges for the database. +* to a specified backup, while keeping all the associated privileges for the database. -* To restore a database to a write mode again after it has been lost (for example, due to a disaster). -See xref:clustering/disaster-recovery.adoc[] for more information. +* to a write mode again after it has been lost (for example, due to a disaster). +// See xref:clustering/disaster-recovery.adoc[] for more information. [CAUTION] ==== @@ -256,7 +256,7 @@ See link:https://neo4j.com/docs/cdc/current/[CDC documentation] for more details Before recreating a database, any eventual quarantined states need to be addressed. For more information, see xref:clustering/databases.adoc#recreate-databases[Standard databases -> Error handling]. -You need xref:authentication-authorization/dbms-administration.adoc#access-control-dbms-administration-database-management[the DBMS `DATABASE MANAGEMENT` privileges] to run the recreate procedure. +You need xref:authentication-authorization/dbms-administration.adoc#access-control-dbms-administration-database-management[the `CREATE DATABASE` and `DROP DATABASE` privileges] to run the recreate procedure. [[recreate-seeding-options]] === Seeding options and configurations @@ -294,7 +294,7 @@ CALL dbms.cluster.recreateDatabase("neo4j", {seedingServers: ["serverId1", "serv [[undefined-servers]] ==== Undefined servers -If you provide an empty list of seeding servers or do not specify a `seedURI`, Neo4j automatically selects all available allocations of the database as seeders. +If you provide an empty list of seeding servers and do not specify a `seedURI`, Neo4j automatically selects all available allocations of the database as seeders. The store will be replaced by the most up-to-date seeder available in the cluster. [source, shell] From b3c962e0a060d85c71230f39e3ebb682fa6da22d Mon Sep 17 00:00:00 2001 From: NataliaIvakina <82437520+NataliaIvakina@users.noreply.github.com> Date: Thu, 19 Sep 2024 15:43:46 +0200 Subject: [PATCH 07/11] Update databases.adoc --- modules/ROOT/pages/clustering/databases.adoc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/ROOT/pages/clustering/databases.adoc b/modules/ROOT/pages/clustering/databases.adoc index 9a1eea5cb..e036ca096 100644 --- a/modules/ROOT/pages/clustering/databases.adoc +++ b/modules/ROOT/pages/clustering/databases.adoc @@ -243,9 +243,8 @@ The recreate procedure works only for real user databases and not for composite Keep in mind the recreate procedure results in downtime while the stores get updated. The time is unbounded and may depend on different factors -- for example, the size of the store, network speed, etc. -The recreate procedure selects the most up-to-date seed from the defined seeding servers. -If only a subset of the previous cluster members is specified as seeders, there is a risk of data loss. -To avoid this, ensure you back up the current store before replacing it with a seed from a URI, so the latest state can be restored if needed. +The database recreation process is designed to select the latest seed from the defined seeding servers. +Specifying only a subset of the previous cluster servers as seeders carries a risk of data loss. ==== The database in question can be in an `online` or `offline` state when it is recreated, but a successful operation starts the database regardless of the previous state. @@ -254,7 +253,7 @@ If CDC is enabled for the database, it will still be enabled after recreating th See link:https://neo4j.com/docs/cdc/current/[CDC documentation] for more details. Before recreating a database, any eventual quarantined states need to be addressed. -For more information, see xref:clustering/databases.adoc#recreate-databases[Standard databases -> Error handling]. +For more information, see xref:database-administration/standard-databases/errors.adoc#quarantine[Standard databases -> Error handling]. You need xref:authentication-authorization/dbms-administration.adoc#access-control-dbms-administration-database-management[the `CREATE DATABASE` and `DROP DATABASE` privileges] to run the recreate procedure. @@ -274,6 +273,8 @@ If you provide a URI to a backup or a dump, the stores on all allocations will b The new allocations can be put on any `ENABLED` server in the cluster. See <> for more details. +To avoid possible data loss, ensure you back up the current store before replacing it with a seed from a URI, so the latest state can be restored if needed. + [source, shell] ---- CALL dbms.cluster.recreateDatabase("neo4j", {seedURI: "myBackup"}); From a3be13468ed1bb883816feca31a9e7a6e86ad1de Mon Sep 17 00:00:00 2001 From: NataliaIvakina <82437520+NataliaIvakina@users.noreply.github.com> Date: Fri, 20 Sep 2024 14:10:34 +0200 Subject: [PATCH 08/11] Update databases.adoc --- modules/ROOT/pages/clustering/databases.adoc | 58 ++++++++++++-------- 1 file changed, 36 insertions(+), 22 deletions(-) diff --git a/modules/ROOT/pages/clustering/databases.adoc b/modules/ROOT/pages/clustering/databases.adoc index e036ca096..8c774a78d 100644 --- a/modules/ROOT/pages/clustering/databases.adoc +++ b/modules/ROOT/pages/clustering/databases.adoc @@ -227,47 +227,55 @@ neo4j@neo4j> DRYRUN REALLOCATE DATABASES; [role=label--new-5.24] [[recreate-databases]] -== Recreate databases +== Recreate a database -Neo4j 5.24 introduces the xref:reference/procedures.adoc#procedure_dbms_cluster_recreateDatabase[`dbms.cluster.recreateDatabase()`] procedure, which allows you to restore a database: +Neo4j 5.24 introduces the xref:reference/procedures.adoc#procedure_dbms_cluster_recreateDatabase[`dbms.cluster.recreateDatabase()`] procedure, which allows you: -* to a specified backup, while keeping all the associated privileges for the database. +* To change the database store to a specified backup, while keeping all the associated privileges for the database. -* to a write mode again after it has been lost (for example, due to a disaster). +* To make your database write-available again after it has been lost (for example, due to a disaster). // See xref:clustering/disaster-recovery.adoc[] for more information. [CAUTION] ==== The recreate procedure works only for real user databases and not for composite databases, or the `system` database. -Keep in mind the recreate procedure results in downtime while the stores get updated. +Remember that the recreate procedure results in downtime while the stores get updated. The time is unbounded and may depend on different factors -- for example, the size of the store, network speed, etc. - -The database recreation process is designed to select the latest seed from the defined seeding servers. -Specifying only a subset of the previous cluster servers as seeders carries a risk of data loss. ==== -The database in question can be in an `online` or `offline` state when it is recreated, but a successful operation starts the database regardless of the previous state. +The database in question can be in an `online` or `offline` state when it is recreated, but a successful operation starts the database regardless of its previous state. If CDC is enabled for the database, it will still be enabled after recreating the database, however the chain will be broken. -See link:https://neo4j.com/docs/cdc/current/[CDC documentation] for more details. +See link:https://neo4j.com/docs/cdc/current/backup-restore/[CDC documentation -> Restore backups and snapshots] for more details. Before recreating a database, any eventual quarantined states need to be addressed. For more information, see xref:database-administration/standard-databases/errors.adoc#quarantine[Standard databases -> Error handling]. -You need xref:authentication-authorization/dbms-administration.adoc#access-control-dbms-administration-database-management[the `CREATE DATABASE` and `DROP DATABASE` privileges] to run the recreate procedure. - -[[recreate-seeding-options]] -=== Seeding options and configurations +You need xref:authentication-authorization/dbms-administration.adoc#access-control-dbms-administration-database-management[the `CREATE DATABASE` and `DROP DATABASE` privileges] to run the recreate procedure. -The store to be used during the recreation of a database can be defined in three different ways. -One method uses a backup, while the two others use available allocations in the cluster. +To check if the recreation is successful, use the `SHOW DATABASES` command and verify that all allocations have been started. Additionally, you have the option to modify <> during the recreation process. However, note that the store format, access, and enrichment cannot be altered during recreation. +[[recreate-seeding-options]] +=== Seeding options + +The store to be used during the recreation of a database can be defined in different ways. +One method uses a backup, while others use available allocations in the cluster. + +You can use either <> or <> to specify the source from which the database should be recreated. + +* If you define neither, an error is thrown. + +* If you define both of them, then `seedingServers` must be an empty list. + +* If `seedingServers` is not empty and `seedURI` is also defined, an error will occur. +See <> for more details. + [[uri-seed]] -==== `seedURI` +==== Use backup as a seed If you provide a URI to a backup or a dump, the stores on all allocations will be replaced by the backup or the dump at the given URI. The new allocations can be put on any `ENABLED` server in the cluster. @@ -277,13 +285,19 @@ To avoid possible data loss, ensure you back up the current store before replaci [source, shell] ---- -CALL dbms.cluster.recreateDatabase("neo4j", {seedURI: "myBackup"}); +CALL dbms.cluster.recreateDatabase("neo4j", {seedURI: "s3:/myBucket/myBackup.backup"}); ---- [[seed-servers]] -==== `seedingServers` +==== Use available allocations as seed + +The database recreation process is designed to select the latest seed from the seeding servers. +Specifying only a subset of the previous cluster servers as seeders carries a risk of data loss. + +[[specified-servers]] +===== Specified servers -Specify a set of available servers. +You can specify a set of available servers. The stores on all allocations will be synchronized to the most up-to-date store from the defined servers. The number of defined servers cannot exceed the number of total allocations in the desired topology. @@ -293,7 +307,7 @@ CALL dbms.cluster.recreateDatabase("neo4j", {seedingServers: ["serverId1", "serv ---- [[undefined-servers]] -==== Undefined servers +===== Undefined servers If you provide an empty list of seeding servers and do not specify a `seedURI`, Neo4j automatically selects all available allocations of the database as seeders. The store will be replaced by the most up-to-date seeder available in the cluster. @@ -312,7 +326,7 @@ This means the store is replaced by the most up-to-date seeder if available; oth [source, shell] ---- -CALL dbms.cluster.recreateDatabase("neo4j", {seedingServers: [], seedURI: "myBackup"}); +CALL dbms.cluster.recreateDatabase("neo4j", {seedingServers: [], seedURI: "s3:/myBucket/myBackup.backup"}); ---- [[alter-topology-recreate]] From 5b927afc250013290930330e5fc4d6c43b4a8988 Mon Sep 17 00:00:00 2001 From: NataliaIvakina <82437520+NataliaIvakina@users.noreply.github.com> Date: Mon, 23 Sep 2024 09:34:41 +0200 Subject: [PATCH 09/11] Apply suggestions from code review --- modules/ROOT/pages/clustering/databases.adoc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/ROOT/pages/clustering/databases.adoc b/modules/ROOT/pages/clustering/databases.adoc index 8c774a78d..5afa602f3 100644 --- a/modules/ROOT/pages/clustering/databases.adoc +++ b/modules/ROOT/pages/clustering/databases.adoc @@ -270,9 +270,9 @@ You can use either <> or <> * If you define neither, an error is thrown. * If you define both of them, then `seedingServers` must be an empty list. +See <> for more details. * If `seedingServers` is not empty and `seedURI` is also defined, an error will occur. -See <> for more details. [[uri-seed]] ==== Use backup as a seed @@ -281,7 +281,6 @@ If you provide a URI to a backup or a dump, the stores on all allocations will b The new allocations can be put on any `ENABLED` server in the cluster. See <> for more details. -To avoid possible data loss, ensure you back up the current store before replacing it with a seed from a URI, so the latest state can be restored if needed. [source, shell] ---- From 8f74faa8eacabed7ea7cbc63450bf1d7465661a7 Mon Sep 17 00:00:00 2001 From: NataliaIvakina <82437520+NataliaIvakina@users.noreply.github.com> Date: Mon, 23 Sep 2024 13:45:46 +0200 Subject: [PATCH 10/11] Implement comments on CDC and using the latest store --- modules/ROOT/pages/clustering/databases.adoc | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/modules/ROOT/pages/clustering/databases.adoc b/modules/ROOT/pages/clustering/databases.adoc index 5afa602f3..ce1a31cf8 100644 --- a/modules/ROOT/pages/clustering/databases.adoc +++ b/modules/ROOT/pages/clustering/databases.adoc @@ -246,8 +246,8 @@ The time is unbounded and may depend on different factors -- for example, the si The database in question can be in an `online` or `offline` state when it is recreated, but a successful operation starts the database regardless of its previous state. -If CDC is enabled for the database, it will still be enabled after recreating the database, however the chain will be broken. -See link:https://neo4j.com/docs/cdc/current/backup-restore/[CDC documentation -> Restore backups and snapshots] for more details. +If your database has Change Data Capture (CDC) enabled, the CDC chain will stop when the database is recreated, even though CDC remains enabled in the recreated database. +To restore CDC functionality, follow the guide on how link:https://neo4j.com/docs/cdc/current/existing-databases/[to initialize CDC applications from an existing database]. Before recreating a database, any eventual quarantined states need to be addressed. For more information, see xref:database-administration/standard-databases/errors.adoc#quarantine[Standard databases -> Error handling]. @@ -288,10 +288,16 @@ CALL dbms.cluster.recreateDatabase("neo4j", {seedURI: "s3:/myBucket/myBackup.bac ---- [[seed-servers]] -==== Use available allocations as seed +==== Use available servers as a seed -The database recreation process is designed to select the latest seed from the seeding servers. -Specifying only a subset of the previous cluster servers as seeders carries a risk of data loss. +After the recreation is complete, the database will have the latest data store from the seeding servers. + +[CAUTION] +==== +Recreation is based on remaining stores or a store defined by the user. +This means that stores which were lost or not defined are not used for the recreation. +If not used stores were more up to date than the used ones, this results in data loss. +==== [[specified-servers]] ===== Specified servers From 44e564148640771ce0ab7559da528acf2ddf65fd Mon Sep 17 00:00:00 2001 From: NataliaIvakina <82437520+NataliaIvakina@users.noreply.github.com> Date: Mon, 23 Sep 2024 14:06:47 +0200 Subject: [PATCH 11/11] Update modules/ROOT/pages/clustering/databases.adoc --- modules/ROOT/pages/clustering/databases.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ROOT/pages/clustering/databases.adoc b/modules/ROOT/pages/clustering/databases.adoc index ce1a31cf8..fb0ddc566 100644 --- a/modules/ROOT/pages/clustering/databases.adoc +++ b/modules/ROOT/pages/clustering/databases.adoc @@ -325,7 +325,7 @@ CALL dbms.cluster.recreateDatabase("neo4j", {seedingServers: []}); [[undefined-servers-backup]] ===== Undefined servers with fallback backup -If both an empty list of seeding servers and a `seedURI` are provided, the system finds all available allocations of the database and use those as seeders. +If both an empty list of seeding servers and a `seedURI` are provided, Neo4j finds all available allocations of the database and use those as seeders. However, if no available servers can be found, the database is recreated based on the backup or the dump defined by the URI. This means the store is replaced by the most up-to-date seeder if available; otherwise, the backup is used.