Closed jan-kolarik closed 1 year ago
It's a long shot and I still do not have reliable reproducer, but: I have two sets of repository metadata, the repodata/* files are exactly the same, updated and valid. But the solv/fedora.solv files in both locations are different. dnf5 happily uses both of these caches without downloading anything, and of course I can see different outputs of the repoclosure command with these caches.
Could it be, that we check cache validity according downloaded metadata, but related *.solv(x) files are then used even if they are stale and not consistent with repodata?
I think not, we write at the begging of the *.solv(x) files a checksum of corresponding repomd.xml and those have to match. https://github.com/rpm-software-management/dnf5/blob/main/libdnf/repo/solv_repo.cpp#L139
Yeah, I've just found it. One more interesting thing - according to dumpsolv fedora.solv file contains also filelists metadata, which is kind of wierd. They should be in fedora-filelists.solvx, shouldnt't they? These files in both cache locations differ. The fedora-filelists.solvx are the same. So maybe some flaw in writing *.solv files?
So both sets of *.solv files are valid, created from the same repomd.xml and still contain different data.
There was some potentially similar issue with the comps
metadata recently: https://github.com/rpm-software-management/dnf5/pull/346. Maybe it's something of a similar manner...
I have made a libsolv PR: https://github.com/openSUSE/libsolv/pull/531 as a possible solution.
Having no metadata present on the system after running a dnf5 command, f.e.
search
, the necessary fresh metadata are downloaded from the remote repositories. When subsequently running some other command, which needs some additional metadata likeFILELISTS
forrepoclosure
, metadata are being downloaded and are apparently stored on the system as observing with thels
command, but they are probably not complete or in incorrect state, because the command reports different results than when running it on the system without any metadata present before.I am providing an example below which was discovered during the review of https://github.com/rpm-software-management/dnf5/pull/500 and it requires the changes from this PR.
Output of the
dnf5 repoclosure
command when fresh metadata are present before on the system, butFILELISTS
are missing:Output of the
dnf5 repoclosure
command when no metadata are present before on the system: