trove/doc/source/user/upgrade-datastore.rst
Przemysław Godek 2fd324357b Add Redis datastore upgrade
This patch adds support for upgrading Redis datastore - both single
instance and cluster.

It is achievied in a similar way to MySQL/Mariadb. Steps are:
    + For each node do:
        + stop database
        + preserve configuration files,
        + unmount data volume,
        + create new instance with new datastore,
        + enter restarting mode
        + mount data volume,
        + restore configuration files,
        + reload datastore

Note that due to the Redis Cluster design and Trove approach (all
nodes are master nodes) we do not perform real rolling upgrade - some
Redis slots may be unavailable while upgrading node associated with
them.

This patch adds also a user documentation about upgrading datastores
using Redis as an example.

Story: #2005421
Task: #30443
Co-Authored-By: Kasper Hasior <k.hasior@samsung.com>
Change-Id: I60cddb3a41d2cc7024cbec3d2fd2038d79446507
Signed-off-by: Kasper Hasior <k.hasior@samsung.com>
2019-05-16 13:07:00 +00:00

3.7 KiB

Upgrade datastore

You can upgrade your datastore version. When you perform an upgrade, the system automatically manages data and configuration files of your database.

To perform datastore upgrade, you need:

  • A supported OS image with the target datastore version.
  • A Trove database instance to be upgrade.

This example shows you how to upgrade Redis datastore (version 3.2.6) for a single instance database.

Note

Before you begin make sure that:

  • Your target datastore is binary compatible with the current datastore. Each database provider has its own compatibilty policy. Usually there shouldn't be any problem when performing an upgrade within minor versions.
  • You do not downgrade your datastore.
  • Target versions is supported by Trove. For instance, Trove doesn't support Cassandra >=2.2 at this moment so you shouldn't perform an upgrade from 2.1 to 2.2.

Upgrading datastore

  1. Check instance status

    Use openstack database instance list to check whether the status of your instance is ACTIVE.

    $openstack database instance list
     +--------------------------------------+------------+-----------+-------------------+--------+-----------+------+-----------+
     | ID                                   | Name       | Datastore | Datastore Version | Status | Flavor ID | Size | Region    |
     +--------------------------------------+------------+-----------+-------------------+--------+-----------+------+-----------+
     | 55411e95-1670-497f-8d92-0179f3b4fdd4 | redis_test | redis     | 3.2.6             | ACTIVE | 6         |    5 | RegionOne |
     +--------------------------------------+------------+-----------+-------------------+--------+-----------+------+-----------+
  2. Check if target version is available

    Use openstack datastore version list command to list all available versions your datastore.

    $openstack datastore version list redis
     +--------------------------------------+-------+
     | ID                                   | Name  |
     +--------------------------------------+-------+
     | 483debec-b7c3-4167-ab1d-1765795ed7eb | 3.2.6 |
     | 507f666e-193c-4194-9d9d-da8342dcb4f1 | 3.2.7 |
     +--------------------------------------+-------+
  3. Run upgrade

    Use openstack database instance command to upgrade your datastore for the selected instance.

    $openstack database instance 55411e95-1670-497f-8d92-0179f3b4fdd4 3.2.7
  4. Wait until status changes from UPGRADE to ACTIVE

    You can use openstack database instance list to check the current status.

    $openstack database instance list
     +--------------------------------------+------------+-----------+-------------------+---------+-----------+------+-----------+
     | ID                                   | Name       | Datastore | Datastore Version | Status  | Flavor ID | Size | Region    |
     +--------------------------------------+------------+-----------+-------------------+---------+-----------+------+-----------+
     | 55411e95-1670-497f-8d92-0179f3b4fdd4 | redis_test | redis     | 3.2.7             | UPGRADE | 6         |    5 | RegionOne |
     +--------------------------------------+------------+-----------+-------------------+---------+-----------+------+-----------+

Other datastores

Upgrade for other datastores works in the same way. Currently Trove supports upgrades for the following datastores:

  • MySQL,
  • MariaDB,
  • Redis.