-
Notifications
You must be signed in to change notification settings - Fork 39
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
MySQL metadata backend #25
Comments
@mennozon I've been working on a fork of backy2 for some months now. I'd be interested in adding MySQL/MariaDB as an additional supported database dialect if someone would volunteer as a tester... Please see https://github.com/elemental-lf/benji. |
Thanks @elemental-lf, with the help of a colleague I was able to get it up and running for almost a month now. I'll clean up the changes and submit a pull request so this issue can be closed, feel free to also add it to benji if you like. |
@mennozon glad to hear that you're up and running. I'll have a look at your PR when it's ready. I've already made some changes based on your original patch. Benji wasn't affected by the auto column issue as the schema has changed a bit in relation to Backy2. |
I just submitted the pull request, I have this running for about a month now without any issues and I just build a new cluster to test backy initdb and a new backup from my Ceph cluster. |
I'm trying to get MariaDB working as a meta backend but I'm running into some issues.
Using 2.9.17 configured with MySQL meta backend running backy2 initdb results in an error:
sqlalchemy.exc.CompileError: (in table 'stats', column 'version_name'): VARCHAR requires a length on dialect mysql
This was resolved by defining the length of strings in sql.py for the affected entries, see attached patch below.
Next issue I ran into when running initdb is:
sqlalchemy.exc.ProgrammingError: (mysql.connector.errors.ProgrammingError) 1075 (42000): Incorrect table definition; there can be only one auto column and it must be defined as a key [SQL: '\nCREATE TABLE blocks (\n\tuid VARCHAR(32), \n\tversion_uid VARCHAR(36) NOT NULL, \n\tid INTEGER NOT NULL AUTO_INCREMENT, \n\tdate DATETIME NOT NULL, \n\tchecksum VARCHAR(128), \n\tsize BIGINT, \n\tvalid INTEGER NOT NULL, \n\tPRIMARY KEY (version_uid, id), \n\tFOREIGN KEY(version_uid) REFERENCES versions (uid)\n)\n\n']
I’m not sure how to fix this, if I only define one with primary_key=True I can run initdb successful but then I run into errors with duplicated entries when running a backup, example output:
Any idea what I’m doing wrong? This is the patch with changes I've made.
The text was updated successfully, but these errors were encountered: