-
Notifications
You must be signed in to change notification settings - Fork 24
Only go through the changed repositories on the re-run. #311
Conversation
@@ -355,8 +355,45 @@ def pre_migrate_all_without_content(plan): | |||
# filter by repo type | |||
repos_to_check = plan.type_to_repo_ids[plugin_plan.type] | |||
|
|||
mongo_repo_q = mongo_Q(repo_id__in=repos_to_check) | |||
mongo_repo_qs = Repository.objects(mongo_repo_q) | |||
# figure out which repositories/importers/distributors were updated since the last run |
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.
ApproachLooking at the last updated times in the pulp2to3 tables for repositories/importers/distributors.
|
Just a note, I'd like to see this as a comment at the start of the code-section. I'm glad that my understanding after reading the code matches this - but it'd be WAY easier for the next person, to have this summary right next to the complicated scenario it describes. |
ad9bd7b
to
f9efe5d
Compare
f9efe5d
to
0efe6b1
Compare
The PR looks good to me. I would add comments on some querysets, while reading the code i needed to go back up and re-fresh my memory about what |
7f5c476
to
958d33e
Compare
This improved a huge setup migration only by 25% which is not good enough, so I continue working on it |
f797227
to
0b27608
Compare
The most-recent pushed changes took the migration-setup from 8.5 hours down to 1. There may be more we can do, but I think an order of magnitude is a great place to start. |
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.
This code had a 10x impact on our worst-case server migration. I approve; I'd like to see it accepted, and if there's more to do in this area, let's do it in a new issue/PR.
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.
This looks good, I just left some suggestions about unrelated code.
Also improved how repo type is determined for complex plans. There is no need to look at repo-content relations in such case becasue the plugin type is clear from the plan. closes #7779 https://pulp.plan.io/issues/7779
0b27608
to
bc4ab3a
Compare
re #7779
https://pulp.plan.io/issues/7779