From d9448a298fb2bd744c5bf3abb360afebae905eea Mon Sep 17 00:00:00 2001 From: Anna Stuchlik Date: Thu, 23 Nov 2023 12:44:45 +0100 Subject: [PATCH] doc: fix rollback in the 4.6-to-5.0 upgrade guide This commit fixes the rollback procedure in the 4.6-to-5.0 upgrade guide: - The "Restore system tables" step is removed. - The "Restore the configuration file" command is fixed. - The "Gracefully shutdown ScyllaDB" command is fixed. In addition, there are the following updates to be in sync with the tests: - The "Backup the configuration file" step is extended to include a command to backup the packages. - The Rollback procedure is extended to restore the backup packages. - The Reinstallation section is fixed for RHEL. Refs https://github.com/scylladb/scylladb/issues/11907 This commit must be backported to branch-5.4, branch-5.2, and branch-5.1 Closes scylladb/scylladb#16155 (cherry picked from commit 1e80bdb440c85ddfb8e8978ecb6642fc398c9798) --- docs/upgrade/_common/upgrade-guide-v4-rpm.rst | 40 +++++++++---------- .../upgrade-guide-v5-ubuntu-and-debian-p1.rst | 6 ++- .../upgrade-guide-v5-ubuntu-and-debian-p2.rst | 24 ++++------- 3 files changed, 31 insertions(+), 39 deletions(-) diff --git a/docs/upgrade/_common/upgrade-guide-v4-rpm.rst b/docs/upgrade/_common/upgrade-guide-v4-rpm.rst index 30855b275c..7bf7a19849 100644 --- a/docs/upgrade/_common/upgrade-guide-v4-rpm.rst +++ b/docs/upgrade/_common/upgrade-guide-v4-rpm.rst @@ -58,9 +58,14 @@ When the upgrade is completed on all nodes, remove the snapshot with the ``nodet Backup the configuration file ------------------------------ + +Back up the ``scylla.yaml`` configuration file and the ScyllaDB packages +in case you need to rollback the upgrade. + .. code:: sh - sudo cp -a /etc/scylla/scylla.yaml /etc/scylla/scylla.yaml.backup-src + sudo cp -a /etc/scylla/scylla.yaml /etc/scylla/scylla.yaml.backup + sudo cp /etc/yum.repos.d/scylla.repo ~/scylla.repo-backup Stop ScyllaDB --------------- @@ -122,29 +127,33 @@ Rollback Steps ============== Gracefully shutdown ScyllaDB ----------------------------- + .. code:: sh nodetool drain - .. include:: /rst_include/scylla-commands-stop-index.rst + nodetool snapshot + sudo service scylla-server stop -Download and install the old release +Restore and install the old release ------------------------------------ -#. Remove the old repo file. +#. Restore the |SRC_VERSION| packages backed up during the upgrade. .. code:: sh - sudo rm -rf /etc/yum.repos.d/scylla.repo + sudo cp ~/scylla.repo-backup /etc/yum.repos.d/scylla.repo + sudo chown root.root /etc/yum.repos.d/scylla.repo + sudo chmod 644 /etc/yum.repos.d/scylla.repo -#. Update the |SCYLLA_REPO|_ to |SRC_VERSION|. #. Install: .. code:: console sudo yum clean all sudo rm -rf /var/cache/yum - sudo yum remove scylla\\*tools-core - sudo yum downgrade scylla\\* -y - sudo yum install scylla + sudo yum downgrade scylla-\*cqlsh -y + sudo yum remove scylla-\*cqlsh -y + sudo yum downgrade scylla\* -y + sudo yum install scylla -y Restore the configuration file @@ -153,18 +162,7 @@ Restore the configuration file .. code:: sh sudo rm -rf /etc/scylla/scylla.yaml - sudo cp -a /etc/scylla/scylla.yaml.backup-src | /etc/scylla/scylla.yaml - -Restore system tables ---------------------- - -Restore all tables of **system** and **system_schema** from previous snapshot because |NEW_VERSION| uses a different set of system tables. See :doc:`Restore from a Backup and Incremental Backup ` for details. - -.. code:: sh - - cd /var/lib/scylla/data/keyspace_name/table_name-UUID/snapshots// - sudo cp -r * /var/lib/scylla/data/keyspace_name/table_name-UUID/ - sudo chown -R scylla:scylla /var/lib/scylla/data/keyspace_name/table_name-UUID/ + sudo cp /etc/scylla/scylla.yaml-backup /etc/scylla/scylla.yaml Reload systemd configuration --------------------------------- diff --git a/docs/upgrade/_common/upgrade-guide-v5-ubuntu-and-debian-p1.rst b/docs/upgrade/_common/upgrade-guide-v5-ubuntu-and-debian-p1.rst index c1b5baba43..7017961e5b 100644 --- a/docs/upgrade/_common/upgrade-guide-v5-ubuntu-and-debian-p1.rst +++ b/docs/upgrade/_common/upgrade-guide-v5-ubuntu-and-debian-p1.rst @@ -60,9 +60,13 @@ When the upgrade is completed on all nodes, remove the snapshot with the ``nodet Backup the configuration file ------------------------------ +Back up the ``scylla.yaml`` configuration file and the ScyllaDB packages +in case you need to rollback the upgrade. + .. code:: sh - sudo cp -a /etc/scylla/scylla.yaml /etc/scylla/scylla.yaml.backup-src + sudo cp -a /etc/scylla/scylla.yaml /etc/scylla/scylla.yaml.backup + sudo cp /etc/apt/sources.list.d/scylla.list ~/scylla.list-backup Gracefully stop the node ------------------------ diff --git a/docs/upgrade/_common/upgrade-guide-v5-ubuntu-and-debian-p2.rst b/docs/upgrade/_common/upgrade-guide-v5-ubuntu-and-debian-p2.rst index 421cb522d2..40b9572bc6 100644 --- a/docs/upgrade/_common/upgrade-guide-v5-ubuntu-and-debian-p2.rst +++ b/docs/upgrade/_common/upgrade-guide-v5-ubuntu-and-debian-p2.rst @@ -44,7 +44,6 @@ For each of the nodes you rollback to |SRC_VERSION|, you will: * Drain the node and stop Scylla * Retrieve the old ScyllaDB packages * Restore the configuration file -* Restore system tables * Reload systemd configuration * Restart ScyllaDB * Validate the rollback success @@ -59,17 +58,19 @@ Gracefully shutdown ScyllaDB .. code:: sh nodetool drain + nodetool snapshot sudo service scylla-server stop -Download and install the old release +Restore and install the old release ------------------------------------ -#. Remove the old repo file. +#. Restore the |SRC_VERSION| packages backed up during the upgrade. .. code:: sh - sudo rm -rf /etc/apt/sources.list.d/scylla.list + sudo cp ~/scylla.list-backup /etc/apt/sources.list.d/scylla.list + sudo chown root.root /etc/apt/sources.list.d/scylla.list + sudo chmod 644 /etc/apt/sources.list.d/scylla.list -#. Update the |SCYLLA_REPO|_ to |SRC_VERSION|. #. Install: .. code-block:: @@ -85,18 +86,7 @@ Restore the configuration file .. code:: sh sudo rm -rf /etc/scylla/scylla.yaml - sudo cp -a /etc/scylla/scylla.yaml.backup-src | /etc/scylla/scylla.yaml - -Restore system tables ---------------------- - -Restore all tables of **system** and **system_schema** from the previous snapshot because |NEW_VERSION| uses a different set of system tables. See :doc:`Restore from a Backup and Incremental Backup ` for reference. - -.. code:: sh - - cd /var/lib/scylla/data/keyspace_name/table_name-UUID/snapshots// - sudo cp -r * /var/lib/scylla/data/keyspace_name/table_name-UUID/ - sudo chown -R scylla:scylla /var/lib/scylla/data/keyspace_name/table_name-UUID/ + sudo cp /etc/scylla/scylla.yaml-backup /etc/scylla/scylla.yaml Reload systemd configuration ----------------------------