-
Notifications
You must be signed in to change notification settings - Fork 49
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
feat: User migration scripts #401
Conversation
Several scripts to assist in user migration from MySQL to spanner. Issue: #286
Sigh, typo. I've updated to address the two issues I believe are related. (Hilariously, I got the issue |
…nto user_migration
np, just making sure I wasn't missing something |
…age-rs into user_migration
@jrconlin following the setup instructions here, regarding step 2: where does the |
^ ah, nvm. I see now. Following the example here going to assume I create this file and that it's used as the |
When I run
Anyone else seeing this? I'm running from OSX, MySQL 8.0.18 if that helps. Edit: I also kept poking around and tried with |
Looks like this might be a known issue with the caching_sha2_password plugin against newer MySQL versions I have tried the suggested alter workaround to no avail. @jrconlin -what version of MySQL are you testing this against? Looks like 8.x might just be too new for (FWIW, I don't think it matters if this script might require an older MySQL version, just noting this for anyone else trying to test this out) |
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.
we can merge as is but this needs a couple more bits:
- collection_id creation in transaction
- (probably) handle users exceeding batch limit
- how to handle errors during a user migration. can the entire user's move be in one transaction (so if an error happens, we cleanly abort)? and if we abort a user's migration should we retry? or just report the user id that failed for fixing up later?
…nto user_migration
@tublitzed My server is reporting it's "5.7.28-0ubuntu0.18.04.4", which is what I get out of |
@pjenvey Fixed the |
@jrconlin I downgraded to MySQL 5.7, still seem same errors from OSX. It'd probably be good to confirm we can get at least a few people able to run this locally so we can effectively test client behaviour internally before handing off to QA. IIRC the plan was to test locally first, so I don't want that to fall entirely to you if you're the only one who can run this :) Also curious if maybe it's just my machine. @pjenvey are you able to run this locally? |
Also kinda curious if this might be a mac thing vs. linux thing. (if it is, i am even LESS enamored with mysql). IIUC, the scripts would be run from debian sh/bash shells, since that's what GCP provides. I'm running ubuntu, which is a debian fork, so the libraries should match up reasonably well. |
tools/user_migration/migrate_user.py
Outdated
cursor = database.cursor() | ||
cursor.execute( | ||
"""create table if not exists migration ( | ||
fxa_uid varchar(255) NOT NULL PRIMARY KEY, |
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.
With this being for the python syncstorage side to reference, I think it will be much easier to use its "legacy" userid
vs syncstorage-rs's fxa_uid
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.
Yeah, but "userid" is kinda db dependent since it can come off of the db row. fxa_uid isn't. I'd rather there be zero chance of collision here, so I'd prefer to use fxa_uid.
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.
Cool, I forgot it's really not difficult to get at either (it's already setup on the user dict/object "fxa_uid" field).
…age-rs into user_migration
Issue: #286
Description
Several scripts to assist in user migration from MySQL to spanner. Consult the
README.md
file for details on use and configuration.Testing
move_dsns.lst
config file to point to the correct mysql and spanner instances. (e.g.move_users.lst
(e.g.1
)python3 -m venv venv && . venv/bin/activate && pip install -r requirements.txt
) Run thepython3 migrate_user.py
script.Processsing... # -> ###:###
which displays the original mysql
userid
and the spannerfxa_uid:fxa_kid
Issue(s)
Issue #286, mozilla-services/services-engineering#18