Skip to main content
Version: 4.5

Procedure to upgrade Redhat MariaDB (v10.2) to v10.3 or v10.5

Description

The default Mariadb version offered till pipeline version v3.7 is mariadb v10.2 and in pipeline v4.0 the default version changed to mariadb v10.3. This procedure provides the details to upgrade MariaDB version to latest available version v10.5

Before you upgrade a production environment, use the procedures in this document to upgrade non-production environment that reproduces your production environment, to test your application to make sure they are compatible with the new version.

Prerequisites

  1. You need to be part of ng-ngdc--dba NG to perform database upgrade.
  2. You need to have kubectl (or) oc binary installed on your machine, we will use kubectl or oc binary to perform few database updates part of the upgrade procedure.

Here is the link to download oc tool (This includes kubectl binary). The link to download the file will be at the end of the github page.

https://github.com/openshift/origin/releases/tag/v3.11.0

Upgrade Procedure

IMPORTANT:

Always backup all of your data before upgrading MariaDB. Use the backup pipeline to perform the backup.

The procedure for performing an in-place upgrade (where your existing data and configuration files are preserved) includes the following steps:

Here is the upgrade path for MariaDB version 10.2 to 10.5

  1. v10.2 ==> v10.3
  2. v10.3 ==> v10.5

Update the repo to new structure.

  1. Create the new branch for database upgrade process. For example we can create the branch named "feature/dbupgrade".

  2. Clone the repo to your local machine and checkout the branch you have created in the previous step. For example "feature/dbupgrade"

  3. Download devexp mariadb boiler-plate repo and make sure you are in release/v4.2 branch.

    Here is the link to devexp boiler-plate repo

    https://dev.azure.com/netapp-ngdc/devexp/_git/mariadb?version=GBrelease%2Fv4.2

  4. Copy the azure-pipelines.yaml from devexp boiler-plate repo to your database repo and update the details to match your repo information.

    ..\azure-pipelines.yaml

    Update the default value of restoreFrom parameter from devexp-stg-2 to your dataspace name.

    parameters:
    - { name: mode, displayName: 'Select action to perform', type: 'string', values: ['refresh',"backup",'backup-list',"restore"], default: 'refresh' }
    - { name: restoreFrom, displayName: 'Provide source to restore from', type: string, default: 'devexp-stg-2' }

    Update the cron schedule to match your previous value.

    schedules:
    - cron: "30 9 * * *"

    Update the mariadb props variable group name mariadb.props under variable section to match your previous value.

    variables:
    - { name: System.Debug, value: true }
    - { group: mariadb.props }

    Update the spaces file mariadb-devexp-stg-2.yml to match your original spaces filename.

    extends:
    template: dbaas/mariadb-devexp-stg-2.yml@spaces
  5. Copy the following files from devexp boiler-plate repo to your database repo.

    ..\devexp-mariadb\templates\standalone-deployment.yaml
  6. Update values.yaml file and append the following content at the end of the file.

    ## Use the below section to control the database upgrade operation.
    #
    db:
    upgrade:
    enabled: true
    analyze:
    enabled: false

    Or you can also refer the values.yaml file from devexp boiler-plate repo and copy the content below the following comment section
    "## New entry to control DB upgrade operation" and paste the copied content to your values.yaml file.

    ..\devexp-mariadb\values.yaml
  7. Commit and push the changes to your repo.

Upgrade to v10.3

  1. Initiate the pipeline using the branch you have created for upgrade activity. Make sure to select the 10.3 under Provide the database version to deploy section.

  2. Wait for pipeline process to complete the database deployment.

  3. If there is no errors in the pipeline process then your database upgrade completed successfuly. Your application database is running in version v10.3

  4. If you are planning to continue your upgrade to version v10.5 then skip this step otherwise make sure to update values.yaml file to disable the upgrade flag.

    ## Use the below section to control the database upgrade operation.
    #
    db:
    upgrade:
    enabled: false
    analyze:
    enabled: false

Upgrade to v10.5

  1. It's time to upgrade the database to v10.5. Initiate the pipeline using the branch you have created for upgrade activity. Make sure to select the 10.5 under Provide the database version to deploy section.

  2. Wait for pipeline process to complete the database deployment.

  3. If there is no errors in the pipeline process then your database upgrade completed successfuly. Your application database is running in version v10.5

  4. Once the upgrade completes successfully make sure to update values.yaml file to disable the upgrade flag.

    ## Use the below section to control the database upgrade operation.
    #
    db:
    upgrade:
    enabled: false
    analyze:
    enabled: false

Troubleshooting

The Mariadb deamon in the pod logs to the standard output, so the log is available in the pod log. The log can be examined by running:

oc logs <pod>
(or)
kubectl logs <pod>