-
Notifications
You must be signed in to change notification settings - Fork 87
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
[RHELC-1130] Fix failing yum transaction validation #1035
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1035 +/- ##
==========================================
+ Coverage 94.89% 94.97% +0.08%
==========================================
Files 50 50
Lines 4565 4601 +36
Branches 812 819 +7
==========================================
+ Hits 4332 4370 +38
+ Misses 156 155 -1
+ Partials 77 76 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@@ -186,19 +225,24 @@ def _perform_operations(self): | |||
# package. This is an inconsistency that could lead to packages | |||
# being outdated in the system after the conversion. | |||
if can_update: | |||
loggerinst.info("Package %s will be updated.", pkg) |
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.
Just a reminder that we can get rid of this later.
We don't need the info log for update/reinstall/downgrade.
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 will remove it from this PR. But I'm wondering if this cannot be used for better debugging of the yum transaction. If yes, then it could be part of https://issues.redhat.com/browse/RHELC-999 What do you think? @r0x0d
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.
So, I guess this is not related. The log message we used here to debug is mainly for us to identify which package is being added to the transaction and the operation related to the package.
What the ticket https://issues.redhat.com/browse/RHELC-999 asks for is to capture error messages and have a better handling for that. We could potentially solve it by improving our callback classes and try to capture and output better messages there.
Also, the errors about dependency solving only happen when we reach the part where try to resolve the dependencies.
Said that, there might be one benefit to log those packages as a DEBUG
. That would help us to understand the operation tied to the package, potentially saving us some time in the analysis when a report is opened.
But I don't think we need to leave this for now, again, improving our callback classes might make more sense than placing those logs here.
92de78d
to
5cabaa0
Compare
5cabaa0
to
162588f
Compare
Finished the part with YUM swap (tests, comments). I have a few questions:
What do you think? @r0x0d @bookwar @bocekm ? I added a short summary to the description of this PR. I also added mapping for the packages which I found has equivalent of them in rhel repositories. Mostly, I finished up with packages centos-* mapped to redhat-* for now (so added just |
except AttributeError: | ||
# Leave the swap packages dict empty, missing swap_pkgs in config file | ||
self.logger.warning("Leaving the swap package list empty. Missing swap_pkgs key in configuration file.") | ||
|
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 liked the extra safety here! Pretty clever!
162588f
to
0d4773a
Compare
I don't mind having the
I do think that we have to propagate the configuration file changes to the other systems to keep it consistent across the variants. Without that, the user might not know that this option is supported by us. I'm not quite sure if we need to implement the solution to DNF as well, although, it would be nice to have, no one asked for that yet and it seems that, at least in DNF, the tool deals with it more reliably. But I do see that we have a bunch of packages that could benefit from this swap and be removed from the exclude list. For example, maybe this is a good candidate: https://github.com/hosekadam/convert2rhel/blob/pr/hosekadam/1035/convert2rhel/data/8/x86_64/configs/oracle-8-x86_64.cfg#L12-L13. Ideally, we want to maintain consistency between the two versions. |
0d4773a
to
de1a771
Compare
a6f6444
to
63aecfc
Compare
63aecfc
to
ce2c439
Compare
ce2c439
to
d91f599
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.
Looks good to me. But an extra pair of eyes might be required before approving.
Nice work!
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.
Minor comments. Though one thing I'd like changed is the title. Try something that addresses the implementation and then how it fixes the bug in the description. Currently the title reads like a bug report
Implementation looks great!
Needs a rebase |
643b12d
to
664c4ea
Compare
Rebased and applied the review |
664c4ea
to
61b1eb4
Compare
61b1eb4
to
46b354f
Compare
Rebased to have changes from #1095 |
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.
Few comments, but in general, it looks pretty good!
46b354f
to
a295f98
Compare
/packit test --labels tier0 |
The problem is related to how we remove the excluded packages. When “rpm -e –nodeps” is used, yum doesn’t know that the package was removed. On the removed package can be depending some other package (pkg1 depends on removed pkg). So then during processing the yum operations (_perform_operations), specifically update operation (reinstall is fine), the dependency (which was satisfied before conversion and then removed by us manually using rpm -e –nodeps) is not checked and results in missing dependency.
This problem with not checking the dependency is solved in later versions, but in the one present in our converted systems. So we need to swap the packages mainly on CentOS 7 (and similar) systems.
The solution uses “yum swap” command, which is based on reinstall and install the package using yum api. The “yum swap” is mostly reimplemented on our side, using the api calls (_swap_problematic_packages).
We can use the swap command when we are removing a package from the original system vendor (like centos-logos) and this package has its replacement from rhel (in this case redhat-logos). This requires the mapping in the configuration file.
Jira Issues: RHELC-1130
Checklist
[RHELC-]
is part of the PR titleRelease Pending
if relevant