cache: Don't use checksum as filename#72
cache: Don't use checksum as filename#72r4f4 wants to merge 1 commit intofedora-modularity:masterfrom
Conversation
In some cases (e.g in Pungi), the metadata is changing all the time, fus is run multiple times a day and the cache just grows. So instead of using checksum we use the reponame passed in the command line invocation and the metadata type to create a filename so that only one copy exists for that reponame. Therefore the cache layout now is: $CACHEDIR/fus/$reponame/$chksum.solv $CACHEDIR/fus/$reponame/$chksum.solvx $CACHEDIR/fus/$reponame/repodata/repomd.xml $CACHEDIR/fus/$reponame/repodata/primary.xml.gz $CACHEDIR/fus/$reponame/repodata/modules.xml.gz $CACHEDIR/fus/$reponame/repodata/group_gz.x86_64.xml.xz $CACHEDIR/fus/$reponame/repodata/filelists.xml.gz Fixes fedora-modularity#71 Signed-off-by: Rafael Fonseca <r4f4rfs@gmail.com>
lubomir
left a comment
There was a problem hiding this comment.
I tested this and did not see any change in solving results. The cache files are renamed and the total size will not grow forever anymore.
| } | ||
|
|
||
| /* Cleanup old libsolv cache files (if any) */ | ||
| remove_files_by_ext (cachedir, ".solvx"); |
There was a problem hiding this comment.
this is really bad idea. that means, if you use even same repo with same metadata, you always remove stuff which is unrelated. I think we should not do this…
There was a problem hiding this comment.
If I can load previous libsolv cache, I don't execute this code (see previous if with return 1).
I just remove the solv files in case I couldn't load previous cache for the same metadata, in which case the metadata has changed. If I don't do that, the libsolv cache will only grow because we'll create a new file every time the metadata changes for that repo.
There was a problem hiding this comment.
Unless it's not a problem that .solv[x] files are never removed.
|
Looks good except of removal of .solv/.solvx files. |
In some cases (e.g in Pungi), the metadata is changing all the time, fus
is run multiple times a day and the cache just grows. So instead of
using checksum we use the reponame passed in the command line invocation
and the metadata type to create a filename so that only one copy exists
for that reponame. Therefore the cache layout now is:
Fixes #71
Signed-off-by: Rafael Fonseca r4f4rfs@gmail.com