RemoveOldRepodataStep for yum publisher not checking repomd.xml to remove old files
Current code in yum distributor publish doesn't actually check the files within the repodata.xml to compare the files that should be kept and files that should be deleted. Instead it makes the assumption that the latest one of each file type (to be removed) is present and removes the files older then the threshold (default 14 days). Given that mtime could be changed by someone touching a file or even moving it on the file system, it may lead to deletion of incorrect files.
for key, val in to_remove.iteritems(): # preserve at least one file of each kind - pop out latest if not set(groupped[key]) - set(val): val.pop(0) for f in val: self.remove_repodata_file(f)
Fix RemoveOldRepodataStep for yum publisher
Previously RemoveOldRepodataStep step didn't actually check the files within the repodata.xml to find the files that should be deleted. Instead it made the assumption that the latest one of each file type (to be removed) was present, and removed the files older than the threshold
Co-authored-by: Blake McIvor firstname.lastname@example.org
#1 Updated by bmbouter over 3 years ago
- Triaged changed from No to Yes
I think in order to do this more accurately we would need to store a record of the published data. Where would we store this type of data?
The rpm devs are really Pulp3 focused right now and Pulp2 is almost near it's maintenance phase. For Pulp2 we could work with you to help prepare a fix. Is there any possibility you would be able to contribute an improvement in this area?
#2 Updated by mtahir over 3 years ago
I have created a fix and pushed it for review. With regards to storing the record of published data, I created the fix with the assumption that any file that is not in repomd.xml, and older than the threshold should be removed.
Please register to edit this issue