-
Notifications
You must be signed in to change notification settings - Fork 86
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
dnf5: Run transaction test for offline transactions #1672
Conversation
The original approach had one advantage that the exactly same transaction that would be performed after |
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'm fine with this, I tested upgrading F39->F40 and it works.
Do you think it makes sense to at least try to resolve the serialized transaction (although it takes a long time so we should properly inform the user on what's going on).
I think we can skip it. The main reason I implemented it this way was that it seemed to not be possible to test the (unserialized) offline transaction because the RPMs are all stored in the same directory. But that turned out to be due to a different bug.
Assuming the transaction serialization logic is reliable, testing the serialized transaction is unnecessary and costs time.
@@ -321,6 +321,27 @@ void Context::Impl::load_repos(bool load_system) { | |||
} | |||
|
|||
void Context::Impl::store_offline(libdnf5::base::Transaction & transaction) { | |||
// Test the transaction |
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.
Scenario:
- a new transaction is tested
get_status()
of the offline transaction status is tested - if there is already an offline transaction in the queue and anAbortedbyUserError
exception is thrown, the tested transaction is discarded- serialize the transaction under test
Can we change the order? Test new transaction only if get_status()
test passes?
get_status()
of offline transaction status is tested- a new transaction is tested
- serialize the transaction under test
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.
That's a good point. Maybe we should do the status test even before downloading transaction packages.
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've added a commit with such optimization. Now the offline transaction status is checked before the download phase.
A serialized offline transaction consists only of local packages downloaded to the `<system state dir>/offline` location. Unfortunately, PGP checks for these packages are disabled by default due to the `localpkg_gpgcheck` option default value. Instead of testing the serialized transaction, this patch performs an RPM transaction test on the originally resolved transaction, which still retains information about the repositories from which the packages were downloaded. This approach also saves time required for deserialization and resolving the testing transaction.
The transaction package download can be a lengthy and network intensive operation. Begin the download only after the user confirms that the previously scheduled offline transaction can be canceled.
e959db7
to
c171eb6
Compare
Rebased due to the conflicts. |
Sorry for the late reply. I agree with Evan that if the serialization is reliable and well-covered by tests (if not, we should address that in a follow-up PR), there's no need for serialized transaction testing. |
A serialized offline transaction consists only of local packages downloaded to the `<system state dir>/offline` location. Unfortunately, PGP checks for these packages are disabled by default due to the `localpkg_gpgcheck` option default value. Instead of testing the serialized transaction, this patch performs an RPM transaction test on the originally resolved transaction, which still retains information about the repositories from which the packages were downloaded. This approach also saves time required for deserialization and resolving the testing transaction. This ports the fix from rpm-software-management#1672 to dnf5daemon.
A serialized offline transaction consists only of local packages downloaded to the `<system state dir>/offline` location. Unfortunately, PGP checks for these packages are disabled by default due to the `localpkg_gpgcheck` option default value. Instead of testing the serialized transaction, this patch performs an RPM transaction test on the originally resolved transaction, which still retains information about the repositories from which the packages were downloaded. This approach also saves time required for deserialization and resolving the testing transaction. This ports the fix from #1672 to dnf5daemon.
A serialized offline transaction consists only of local packages
downloaded to the
<system state dir>/offline
location. Unfortunately,PGP checks for these packages are disabled by default due to the
localpkg_gpgcheck
option default value.Instead of testing the serialized transaction, this patch performs an
RPM transaction test on the originally resolved transaction, which still
retains information about the repositories from which the packages were
downloaded.
This approach also saves time required for deserialization and resolving
the testing transaction.
Resolves: #1668
Resolves: #1667
Tests: rpm-software-management/ci-dnf-stack#1549