-
Notifications
You must be signed in to change notification settings - Fork 5
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
resolve bad migration operation causing drop of permissions (fixes #403) #407
Conversation
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.
Approve the spirit of it as I have no knowledge of DB migration.
Curious, how do you know this will fix the issue since I do not see any new test case reproducing the issue to confirm the fix works?
I assume once this PR is merged, you'll create a new Magpie docker and test a migration in a real PAVICS stack using our birdhouse-deploy recipe?
@@ -43,7 +43,7 @@ def upgrade(): | |||
grp_res_perms = GroupResourcePermissionService.base_query(db_session=session) | |||
usr_res_perms = UserResourcePermissionService.base_query(db_session=session) | |||
|
|||
for perm_list in [grp_res_perms, usr_res_perms]: | |||
for item_id_key, perm_list in [("group_id", grp_res_perms), ("user_id", usr_res_perms)]: |
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 have no idea about DB migration but shouldn't the fix be in a new migration step? Fixing in an existing migration step means a server that already execute this step won't attempt it again and miss out on the fix?
Discard what I said if it makes no sense since I know nothing about DB migration.
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.
It has to be applied there so that a server that did not run the migration will do it properly after rollback.
If added as new step, permissions will still be dropped at that step and later 'new' step will have no effect as there is nothing left to work with.
Migration steps have their own version dissociated from magpie versions.
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.
It has to be applied there so that a server that did not run the migration will do it properly after rollback.
Oh wait so there is a way to rollback a DB migration? I didn't have to rm -rf /data/magpie_persist
when reverting from 3.5.1 to 1.7.3?
@tlvu I will tag another version after the few recent bugfixes are merged. |
Woo a jump from 3.5.1 to 3.8.0? So during last Magpie upgrade, 3.7.0 was available but we didn't want to use it? Before I spend, and potentially waste time on this 3.8.0 again, what tests did you perform on this 3.8.0? Is it integrated here https://github.com/bird-house/birdhouse-deploy/compare/restore-previous-broken-magpie-upgrade-so-we-can-work-on-a-fix, how has it been tested? |
@tlvu, Francis tests the migration to 3.8.0 using this procedure : #407 (comment). |
resolve bad migration operation causing drop of permissions (fixes #403)