MariaDB 10.1 fails during alembic migration

Bug #1855912 reported by Rodolfo Alonso
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Ubuntu Server
New
Undecided
Unassigned
neutron
Fix Released
High
Unassigned
Tags: db
Revision history for this message
Akihiro Motoki (amotoki) wrote :

I wonder what is the importance of this issue. If this is a bug of mariadb 10.1, we can just wait a fix in the mariadb side.

Revision history for this message
Slawek Kaplonski (slaweq) wrote :

@Akihiro: The problem is that Mariadb 10.1 is I think default in Ubuntu 18.04.

Revision history for this message
Rodolfo Alonso (rodolfo-alonso-hernandez) wrote :

Hello:

I tested manually with 10.4 on Ubuntu 18.04.

$ apt-get remove mariadb-server
$ apt purge mariadb-common
$ apt-get install software-properties-common
$ apt update ; apt upgrade -y; apt clean ; apt autoremove -y
$ apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8
$ add-apt-repository "deb [arch=amd64,arm64,ppc64el] http://mariadb.mirror.liquidtelecom.com/repo/10.4/ubuntu $(lsb_release -cs) main"

Then I executed devstack, in master branch, and the installation finished without any problem.

From the MariaDB 10.4 backend:

DDL for neutron.ovn_revision_numbers:
CREATE TABLE `ovn_revision_numbers` (
  `standard_attr_id` bigint(20) DEFAULT NULL,
  `resource_uuid` varchar(36) NOT NULL,
  `resource_type` varchar(36) NOT NULL,
  `revision_number` bigint(20) NOT NULL DEFAULT 0,
  `created_at` datetime NOT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`resource_uuid`,`resource_type`),
  KEY `standard_attr_id` (`standard_attr_id`),
  KEY `ix_ovn_revision_numbers_resource_type` (`resource_type`),
  KEY `ix_ovn_revision_numbers_resource_uuid` (`resource_uuid`),
  CONSTRAINT `ovn_revision_numbers_ibfk_1` FOREIGN KEY (`standard_attr_id`) REFERENCES `standardattributes` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8

DDL for neutron.ovn_hash_ring:
CREATE TABLE `ovn_hash_ring` (
  `node_uuid` varchar(36) NOT NULL,
  `group_name` varchar(256) NOT NULL,
  `hostname` varchar(256) NOT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`node_uuid`,`group_name`),
  KEY `ix_ovn_hash_ring_node_uuid` (`node_uuid`),
  KEY `ix_ovn_hash_ring_group_name` (`group_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8

In OpenStack, we can:
- Wait for a Ubuntu Bionic upgrade of the MariaDB version distribution.
- Add this new repository and install v10.4.

Regards.

Revision history for this message
YAMAMOTO Takashi (yamamoto) wrote :

why do you need this? just for the CI job?

Revision history for this message
Rodolfo Alonso (rodolfo-alonso-hernandez) wrote :

Hello Yamamoto:

I filled this bug because there is an error in a CI job. I "don't need this" for any particular reason but to report the problem found. Anyone using Ubuntu and MariaDB <v10.3 will trigger this error and makes sense to report it.

About the CI job, we can manually force the installation of a new version until the reference image, Ubuntu Bionic, provides an updated version.

Regards.

tags: added: db
Revision history for this message
YAMAMOTO Takashi (yamamoto) wrote :

i wonder why the error is different from https://bugs.launchpad.net/neutron/+bug/1841907

Revision history for this message
YAMAMOTO Takashi (yamamoto) wrote :

i agree it makes sense to install newer version on the CI.
and document the workaround in our installation document.

Changed in neutron:
status: New → Confirmed
importance: Undecided → High
Revision history for this message
Rodolfo Alonso (rodolfo-alonso-hernandez) wrote :

Hello:

Patch in Devstack to add the MariaDB 10.4 repos if:
- Ubuntu Bionic
- "$MYSQL_SERVICE_NAME" == "mariadb"

https://review.opendev.org/#/c/698980

Regards.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to neutron (master)

Related fix proposed to branch: master
Review: https://review.opendev.org/702416

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to neutron (master)

Reviewed: https://review.opendev.org/702416
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=1986865bd5587d303f79f54ff525b38b0bf98bb6
Submitter: Zuul
Branch: master

commit 1986865bd5587d303f79f54ff525b38b0bf98bb6
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Tue Jan 14 13:24:35 2020 +0000

    Add MariaDB 10.3 repository for Ubuntu Bionic

    In order to execute the periodic job "neutron-tempest-mariadb-full",
    using Ubuntu Bionic and MariaDB, a newer version is needed than the
    default package version distributed (10.1).

    Devstack gates are tested with MySQL 5.7. Current Neutron DB schema
    is not working with the reported version 10.1.

    Change-Id: Ie2b5f85a9c0fc26676d44074424cf5a699303805
    Related-Bug: #1855912
    Related-Bug: #1841907

Revision history for this message
LIU Yulong (dragon889) wrote :

For a cloud deployment, the mariadb may be in such 10.1 version, neutron upgrading may failed due to this. So an upgrading WARNING should be added for users when they are going to update the neutron DB schema: the mariadb should be upgraded before neutron.

tags: added: neutron-proactive-backport-potential
tags: removed: neutron-proactive-backport-potential
Changed in neutron:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers