-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mariadb upgrade scenario testing #594
base: main
Are you sure you want to change the base?
Conversation
4b5f69f
to
0897e5e
Compare
0897e5e
to
24e7b06
Compare
) -> None: | ||
mounts = [BindMount(host_path=tmp_path, container_path="/var/lib/mysql")] | ||
mariadb_old = DerivedContainer( | ||
base="registry.suse.com/suse/mariadb:10.6", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no guarantee that you will be able to migrate from 10.6 to newer MariaDB containers.
I believe the test should include a mapping from which version to which newer version, otherwise this test could fail on a new container image, not because it is broken, but because MariaDB does not support migrating 10.6 to version X.Y.
So instead of MARIADB_CONTAINERS
it should be passed something like MARIADB_CONTAINERS_UPGRADE_VERSIONS
, which would be a tuple, or another map style type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alexandrevicenzi as per the docs here: https://mariadb.com/kb/en/upgrading-between-major-mariadb-versions/ we should be able to upgrade between any 2 major versions of mariadb.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the test are we always testing from the previous version to the next version? Aka current version -1 to current version. If yes, then there's no issue.
f'echo "CREATE TABLE test (id serial PRIMARY KEY, num integer, data varchar(32));" | {mariadb_cmd}' | ||
) | ||
con.check_output( | ||
f"echo 'INSERT INTO test (num, data) VALUES (100, \"abcdef\")' | {mariadb_cmd}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to the docs the upgrade touches these:
- Updating the system tables in the mysql database to the newest version. This is very quick.
- mariadb-upgrade also runs mariadb-check --check-upgrade to check if there have been any collation changes between the major versions. This recreates indexes in old tables that are using any of the changed collations. This can take a bit of time if there are a lot of tables or there are many tables which used the changed collation. The last time a collation changed was in MariaDB/MySQL 5.1.23.
It would be nice to touch system tables, such as changing the database charset to a non-standard one.
It would be nice to have a data file that has multiple commands and tables. Ideally creating indexes, so we know that MariaDB can migrate indexes, plus perhaps including more data types than just integer and varchar.
Regular tables are not very likely to break or change unless there's a change in the data type of a column I believe.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have any existing SQL file that has a good load of data(we might have used in earlier experiments) or would you like to recommend any specific dataset for this or we can create our own random data(with indexes for sure)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have any, maybe the maintainer has one. Otherwise, we could grab some dataset from Kaggle if needed.
There's no need to be a big dump, just having a few tables, indexes, and changing things that touch system tables would be sufficient I believe.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additional info:
As per the official mariadb upgrade tests here: https://github.com/MariaDB/server/blob/fd0cc2b1fdee24955d39cdcecbc457324b85b2d2/tests/upgrade_from/test_upgrade.sh, they create a simple dataset for testing the upgrade.
So, i think we don't have to create dataset specific to each versions and the dataset can be common across all the version. But, as you suggested the dataset can have indices and we can also touch the system tables.
[CI:TOXENVS] mariadb
fixes: #504