Database-Versioning-Problem while Upgrading 5.2 -> 5.4 with Federation and MySQL

Hi OpenNebula-Community,

we operate two OpenNebula-Installations in a federation-setup (1 Masterzone, 1 Slavezone; each with its own MySQL-Backend, no HA).

For testingpurposes we wanted to upgrade our lab-environment to the new release 5.4.
Running installation was 5.2.1. Installed on Debian 8 with .deb package from official Repo.
Upgrading to 5.4.0-1 with .deb package from official Repo.

After upgrading according to the upgrade guide, we got a problem on our SLAVE-Node concerning the database-version:

root@cloud01-dev(~)# onedb fsck -S localhost -u oneadmin -p *** -d opennebula
Version mismatch: fsck file is for version
Shared: 5.4.0, Local: 5.4.0

Current database is version
Shared: 5.2.0, Local: 5.4.0

onedb fsck on MASTER-Node was running fine.

We exported the shared tables from MASTER with
onedb backup --federated -v -S localhost -u oneadmin -p *** -d opennebula
and imported on the slave with
onedb restore --federated -v -S localhost -u oneadmin -p *** -d opennebula /tmp/mysql_localhost_opennebula_federated_2017-8-23_10\:7\:42.sql

As with these values the opennebula-daemon wouldnt start, i started investigating. It looks, like the new value in the table db_versioning isnt inserted into the slaves database. As this is the version for the shared tables, i assume, this should be in the federated-tables-snapshot but it isnt included.
I tried updating this info manually (copying from the masternode), now everything seems to work.

After applying this [5.4 onedb fsck error] fix, the ‘onedb fsck’ on the SLAVE is working now and doesnt report any errors.

While reading the code-base it appears, that “db_versioning” isnt considered an federated table:
https://github.com/OpenNebula/one/blob/6b0deba1cc40f7b4febdfd2bb33295d0659c7e00/src/onedb/onedb_backend.rb;
FEDERATED_TABLES = %w(group_pool user_pool acl zone_pool vdc_pool
marketplace_pool marketplaceapp_pool)

In https://github.com/OpenNebula/one/blob/master/src/onedb/onedb.rb line 164 the version gets updated but this probably only runs on MASTERs.

So my question is: How should ‘db_versioning’ be updated, if its only updated by ‘onedb upgrade’ on the MASTER and not a federated table? Did I oversee something?

Thank you in advance
Andreas

PS: I hope i provided enough information. If something is missing, i’ll be happy to answer questions :wink:

1 Like