Conversation
|
There should be an easy way to turn it off for testing purposes, even if it's an internal-only flag that is checked. |
c941425
to
b1bc315
Compare
pulp_2to3_migration/app/migration.py
Outdated
| # find pre-migrated importers that are specified in plan and are not migrated, meaning that | ||
| # whether the remote is missing or it needs to be updated |
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 think it's ok with out the comment, it completely duplicates the code.
| if pulp2content.pulp3_content is not None and not is_lazy_type: | ||
| if pb: | ||
| pb.increment() | ||
| continue | ||
| if pulp2content.pulp3_content is not None and is_lazy_type and not pulp2lazycatalog: | ||
| if pb: | ||
| pb.increment() | ||
| continue |
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 seems like it doesn't matter whether it's lazy or not. How about this instead of two conditions:
if pulp2content.pulp3_content is not None and not pulp2lazycatalog:
 if pb:
 pb.increment()
 continue
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.
pulp2content.pulp3_content is not None and (not is_lazy_type or is_lazy_type and not pulp2lazycatalog)
| lce.is_migrated = True | ||
| dc = DeclarativeContent(content=pulp3content, d_artifacts=[da]) | ||
| dc.extra_data = future_relations | ||
| await self.put(dc) | ||
| Pulp2LazyCatalog.objects.bulk_update(objs=pulp2lazycatalog, | ||
| fields=['is_migrated']) | ||
| else: |
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.
Same concern with flipping the flag here.
9e269de
to
e8d7681
Compare
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.
Thanks!
Please find a way to squash 2 conditions we discussed. LGTM for the rest!
|
The code looks good, and there's a solid improvement of about 40% in my test w/ 2 repos (Fedora 30 and 31) This PR: Intial migration: 798 seconds Master branch: Intial migration: 717 seconds The numbers are still pretty rough though. We should look into what the new chokepoint is. |
[noissue]