-
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
RepoSack: New API to reload system repo #1702
base: main
Are you sure you want to change the base?
Conversation
Introduce a new API to clear all solvables from the system repo and reload fresh data from the RPM database. Re-creating the Base object can be resource-intensive, and there is a use case in dnfdaemon where the current session (which wraps around the Base instance) needs to be reused even after executing an RPM transaction - whether for queries or running another transaction.
It does make me feel uneasy. It basically invalidates the pool right? Libsolv If I understand correctly for example existing |
Yes, that's right. Any place that keeps an id of an installed package is invalid after this call. |
@@ -792,4 +792,9 @@ void SolvRepo::create_environment_solvable( | |||
repodata_internalize(data); | |||
} | |||
|
|||
void SolvRepo::empty() { | |||
// TODO(mblaha): is resuseid=true safe enough? |
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.
Code from libsolv:
if (reuseids && repo->end == pool->nsolvables)
{
/* it's ok to reuse the ids. As this is the last repo, we can
just shrink the solvable array */
It looks like reuseids
works only when the repo is last. DNF places the system repo first. Behind it are available repos. The system repo is last only if it is the only one (we don't have available repos loaded).
Note:
OK. Maybe after the first reload the system repository will be the last one.
You are introducing a new API method When we sort packages and they have the same nevra, the solvable In general we are getting into the untested area of using libsolv. |
Introduce a new API to clear all solvables from the system repo and
reload fresh data from the RPM database.
Re-creating the Base object can be resource-intensive, and there is a
use case in dnfdaemon where the current session (which wraps around the
Base instance) needs to be reused even after executing an RPM
transaction - whether for queries or running another transaction.
For: #1653