Bug 1307207

Summary: Pulp repository sync doesn't clean up old <checksum>.updateinfo.gz files
Product: Red Hat Satellite Reporter: Frank Hirtz <fhirtz>
Component: PulpAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED ERRATA QA Contact: Bruno Rocha <rochacbruno>
Severity: medium Docs Contact:
Priority: high    
Version: 6.1.6CC: bbuckingham, bkearney, bmbouter, daniele, daviddavis, dkliban, ehelms, ggainey, ipanova, jcallaha, jentrena, jomitsch, mhrivnak, mverma, pcreech, pdwyer, rakumar, rchan, riehecky, satellite6-bugs, snemeth, ttereshc, zhunting
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: pulp-2.8.7.7-1,pulp-rpm-2.8.7.9-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1426379 (view as bug list) Environment:
Last Closed: 2017-05-01 13:52:16 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1426379    
Attachments:
Description Flags
Pulp Hotfix (revised)
none
Pulp Hotfix(EL6 Revised)
none
Pulp Hotfix(EL6 Revised) 6.2.8
none
Pulp Hotfix(EL6 Revised) 6.2.8 none

Description Frank Hirtz 2016-02-13 03:26:34 UTC
Description of problem:

When a repo is synced, the old updateinfo metadata isn't removed so we slowly leak diskspace.
[root@satellite ~]# ls /var/lib/pulp/published/yum/master/yum_distributor/Default_Organization-Red_Hat_Enterprise_Linux_Server-Red_Hat_Enterprise_Linux_7_Server_-_Optional_RPMs_x86_64_7Server/1455093381.96/repodata/ | grep updateinfo | wc -l
41

<sync>

[root@satellite yum]# ls /var/lib/pulp/published/yum/master/yum_distributor/Default_Organization-Red_Hat_Enterprise_Linux_Server-Red_Hat_Enterprise_Linux_7_Server_-_Optional_RPMs_x86_64_7Server/1455248661.16/repodata/ | grep updateinfo | wc -l
42

<sync>

[root@satellite repomd]# ls /var/lib/pulp/published/yum/master/yum_distributor/Default_Organization-Red_Hat_Enterprise_Linux_Server-Red_Hat_Enterprise_Linux_7_Server_-_Optional_RPMs_x86_64_7Server/1455267279.56/repodata/ | grep updateinfo | wc -l
43
[root@satellite repomd]# ls /var/lib/pulp/published/yum/master/yum_distributor/Default_Organization-Red_Hat_Enterprise_Linux_Server-Red_Hat_Enterprise_Linux_7_Server_-_Optional_RPMs_x86_64_7Server/1455267279.56/repodata/ | grep updateinfo | tail -5
ddee37007f5c85d0a35c6843d9c38ebd3438cc34-updateinfo.xml.gz
e174f40e37c46d481bcd6f3341b26ddf159f2765-updateinfo.xml.gz
f75adb016418dc188863d09915973753639c1c0c-updateinfo.xml.gz
f9c477638cccf9d225c151374cad3e975d966afb-updateinfo.xml.gz
fb4be52ad81994c3519fc600e3c320fdf05288dc-updateinfo.xml.gz
</snip>

The other metadata files don't appear to show this issue:

<snip>
[root@satellite repomd]# ls /var/lib/pulp/published/yum/master/yum_distributor/Default_Organization-Red_Hat_Enterprise_Linux_Server-Red_Hat_Enterprise_Linux_7_Server_-_Optional_RPMs_x86_64_7Server/1455267279.56/repodata/ | grep -v updateinfo
2dcf826f8cd19e9774ad70e947bbee80acffd718-other.xml.gz
3e800f8eb4bfc89f8e320cda3dd709a8e0bef5f4884e3b622df63b17249e8242-comps.xml
6c24ec45ae612c2c7cb055be3a248a5aed768507-filelists.xml.gz
9fa6016b60e94fe6857add32e12ca73e836878e0-primary.xml.gz
d139afced76cbdbb17a31e021d0071c5bb73e738-comps.xml
repomd.xml
</snip>

Having a look at the master repos on my server:
<snip>
[root@satellite repomd]# for i in `ls -1 /var/lib/pulp/published/yum/master/yum_distributor/ | grep -v 'ivanova\|Library\|epel\|Development\|Live\|default\|Testing'`; do echo -n "$i: "; ls /var/lib/pulp/published/yum/master/yum_distributor/$i/*/repodata | grep updateinfo | wc -l; done
Default_Organization-Red_Hat_Enterprise_Linux_Atomic_Host-Red_Hat_Enterprise_Linux_Atomic_Host_RPMs_x86_64: 5
Default_Organization-Red_Hat_Enterprise_Linux_Server-Red_Hat_Enterprise_Linux_5_Server_RPMs_x86_64_5Server: 42
Default_Organization-Red_Hat_Enterprise_Linux_Server-Red_Hat_Enterprise_Linux_6_Server_Kickstart_x86_64_6_4: 43
Default_Organization-Red_Hat_Enterprise_Linux_Server-Red_Hat_Enterprise_Linux_6_Server_Kickstart_x86_64_6_5: 36
Default_Organization-Red_Hat_Enterprise_Linux_Server-Red_Hat_Enterprise_Linux_6_Server_Kickstart_x86_64_6_6: 34
Default_Organization-Red_Hat_Enterprise_Linux_Server-Red_Hat_Enterprise_Linux_6_Server_Kickstart_x86_64_6_7: 41
Default_Organization-Red_Hat_Enterprise_Linux_Server-Red_Hat_Enterprise_Linux_6_Server_-_Optional_RPMs_x86_64_6Server: 39
Default_Organization-Red_Hat_Enterprise_Linux_Server-Red_Hat_Enterprise_Linux_6_Server_RPMs_x86_64_6Server: 46
Default_Organization-Red_Hat_Enterprise_Linux_Server-Red_Hat_Enterprise_Linux_6_Server_-_Supplementary_RPMs_x86_64_6Server: 37
Default_Organization-Red_Hat_Enterprise_Linux_Server-Red_Hat_Enterprise_Linux_7_Server_Kickstart_x86_64_7_1: 34
Default_Organization-Red_Hat_Enterprise_Linux_Server-Red_Hat_Enterprise_Linux_7_Server_Kickstart_x86_64_7_2: 33
Default_Organization-Red_Hat_Enterprise_Linux_Server-Red_Hat_Enterprise_Linux_7_Server_-_Optional_RPMs_x86_64_7Server: 43
Default_Organization-Red_Hat_Enterprise_Linux_Server-Red_Hat_Enterprise_Linux_7_Server_RPMs_x86_64_7Server: 49
Default_Organization-Red_Hat_Enterprise_Linux_Server-Red_Hat_Enterprise_Linux_7_Server_-_Supplementary_RPMs_x86_64_7Server: 38
Default_Organization-Red_Hat_Enterprise_Linux_Server-Red_Hat_Satellite_Tools_6_1_for_RHEL_5_Server_RPMs_x86_64: 35
Default_Organization-Red_Hat_Enterprise_Linux_Server-Red_Hat_Satellite_Tools_6_1_for_RHEL_6_Server_RPMs_x86_64: 38
Default_Organization-Red_Hat_Enterprise_Linux_Server-Red_Hat_Satellite_Tools_6_1_for_RHEL_7_Server_RPMs_x86_64: 40
Default_Organization-Red_Hat_Enterprise_Virtualization-Red_Hat_Enterprise_Virtualization_Hypervisor_7_Beta_RPMs_x86_64: 43
Default_Organization-Red_Hat_Enterprise_Virtualization-Red_Hat_Enterprise_Virtualization_Manager_3_Beta_RPMs_x86_64_6Server: 53
Default_Organization-Red_Hat_Satellite-Red_Hat_Satellite_6_1_for_RHEL_6_Server_RPMs_x86_64: 52
Default_Organization-Red_Hat_Software_Collections__for_RHEL_Server_-Red_Hat_Software_Collections_RPMs_for_Red_Hat_Enterprise_Linux_6_Server_x86_64_6Server: 42
Default_Organization-Red_Hat_Software_Collections__for_RHEL_Server_-Red_Hat_Software_Collections_RPMs_for_Red_Hat_Enterprise_Linux_7_Server_x86_64_7Server: 37
</snip>

Version-Release number of selected component (if applicable):
pulp-rpm-plugins-2.6.0.19-1.el6.noarch

Steps to Reproduce:
Add Red Hat repository
sync

Additional info:
It looks like there's an upstream report, but it doesn't appear that it went anywhere:

<snip>

https://pulp.plan.io/issues/1045

<snip>
incremental publish does not remove old updateinfo.xml
Added by bcourt 8 months ago. Updated about 1 month ago.

Status:	NEW		
Priority:	Low		
Assignee:	-		
Category:	-		
Severity:	2. Medium	Backwards Incompatible:	No
Version:		Triaged:	Yes
Target Release:		Tags:	
OS:		QA Contact:	
Description

When an incremental publish is performed the old updateinfo.xml is not removed if a checksum is specified. Each publish adds a new updateinfo, which has a different checksum.

After each publish there should be only one updateinfo.xml in the repodata directory.
...
Perhaps other metadata files could leave vestiges also, the fixer should verify that an incremental publishes which must republish all files in repodata properly removes the old ones.
</snip>

Comment 8 pulp-infra@redhat.com 2016-11-21 18:52:34 UTC
The Pulp upstream bug status is at NEW. Updating the external tracker on this bug.

Comment 9 pulp-infra@redhat.com 2016-11-21 18:52:38 UTC
The Pulp upstream bug priority is at Normal. Updating the external tracker on this bug.

Comment 10 Michael Hrivnak 2016-12-05 19:44:15 UTC
*** Bug 1312054 has been marked as a duplicate of this bug. ***

Comment 11 pulp-infra@redhat.com 2016-12-13 11:32:17 UTC
The Pulp upstream bug status is at ASSIGNED. Updating the external tracker on this bug.

Comment 12 pulp-infra@redhat.com 2016-12-15 11:45:46 UTC
The Pulp upstream bug status is at POST. Updating the external tracker on this bug.

Comment 13 pulp-infra@redhat.com 2016-12-20 17:01:54 UTC
The Pulp upstream bug status is at MODIFIED. Updating the external tracker on this bug.

Comment 14 pulp-infra@redhat.com 2016-12-20 17:32:09 UTC
All upstream Pulp bugs are at MODIFIED+. Moving this bug to POST.

Comment 15 pulp-infra@redhat.com 2017-01-10 02:02:34 UTC
The Pulp upstream bug status is at ON_QA. Updating the external tracker on this bug.

Comment 16 pulp-infra@redhat.com 2017-01-16 21:02:50 UTC
The Pulp upstream bug status is at CLOSED - CURRENTRELEASE. Updating the external tracker on this bug.

Comment 21 Satellite Program 2017-02-23 21:08:14 UTC
Please add verifications steps for this bug to help QE verify

Comment 27 Michael Hrivnak 2017-03-22 13:44:38 UTC
The hotfix is broken. Three of the packages are built for el7, and the rest for el6. Anyone running this hotfix likely has the pre-hotfix version of the pulp_rpm plugin, and thus would not see the desired change in behavior.

Zach, would you like to re-build it?

All of that said, unless the existence of these extra updateinfo files is causing problems for a user for some specific reason, my suggestion is to wait for 6.2.9. The old files are safe to ignore.

Comment 28 Zach Huntington-Meath 2017-03-22 19:26:04 UTC
Yes I will rebuild, it. I'll try and have it out as soon as possible.

Comment 29 John Mitsch 2017-03-23 15:24:17 UTC
Created attachment 1265818 [details]
Pulp Hotfix (revised)

Pulp Hotfix (revised)

Comment 31 pulp-infra@redhat.com 2017-03-30 02:07:08 UTC
The Pulp upstream bug status is at POST. Updating the external tracker on this bug.

Comment 32 pulp-infra@redhat.com 2017-03-30 02:07:15 UTC
The Pulp upstream bug priority is at Normal. Updating the external tracker on this bug.

Comment 33 Zach Huntington-Meath 2017-03-30 15:33:05 UTC
Created attachment 1267609 [details]
Pulp Hotfix(EL6 Revised)

Comment 35 pulp-infra@redhat.com 2017-03-30 23:07:02 UTC
The Pulp upstream bug status is at CLOSED - COMPLETE. Updating the external tracker on this bug.

Comment 42 Zach Huntington-Meath 2017-04-10 13:53:28 UTC
Created attachment 1270493 [details]
Pulp Hotfix(EL6 Revised) 6.2.8

Comment 43 Zach Huntington-Meath 2017-04-10 13:54:24 UTC
Created attachment 1270494 [details]
Pulp Hotfix(EL6 Revised) 6.2.8

Comment 46 Bruno Rocha 2017-04-13 15:27:34 UTC
Verified in:

    satellite-6.2.9-2.0.el7sat.noarch


Note:
   For old repositories in this same system I noted some directories with more than 1000+ files, so problem was happening in 6.2.8
   The system was updated for 6.2.9 and problem gone as in verification steps bellow.
   

Steps:

1) Added new product + repository 
2) Sync
3) verified number of updateinfo.xml.gz files 
    [root@cloud-qe-09 ~]# ls /var/lib/pulp/published/yum/master/yum_distributor/Default_Organization-Zooo-newzoo/1492096608.62/repodata/ | grep updateinfo | wc -l
    1
4) Sync again
5) verified if data is updated and have only one file
    [root@cloud-qe-09 ~]# ls /var/lib/pulp/published/yum/master/yum_distributor/Default_Organization-Zooo-newzoo/1492096608.62/repodata/ | grep updateinfo | wc -l
    ls: cannot access /var/lib/pulp/published/yum/master/yum_distributor/Default_Organization-Zooo-newzoo/1492096608.62/repodata/: No such file or directory
    0
    [root@cloud-qe-09 ~]# ls /var/lib/pulp/published/yum/master/yum_distributor/Default_Organization-Zooo-newzoo/1492096810.97/repodata/ | grep updateinfo | wc -l
    1
6) Following steps from https://pulp.plan.io/issues/2096 I removed 2 packaged and synck again

    [root@cloud-qe-09 ~]# ls /var/lib/pulp/published/yum/master/yum_distributor/Default_Organization-Zooo-newzoo/1492096810.97/repodata/ | grep updateinfo | wc -l
    ls: cannot access /var/lib/pulp/published/yum/master/yum_distributor/Default_Organization-Zooo-newzoo/1492096810.97/repodata/: No such file or directory
    0
    [root@cloud-qe-09 ~]# ls /var/lib/pulp/published/yum/master/yum_distributor/Default_Organization-Zooo-newzoo/1492096862.19/repodata/ | grep updateinfo | wc -l
    1


Results:
   repodata leak is not happening, directory and repodata/updateinfo.xml.gz is being cleaned between syncs.

Comment 48 errata-xmlrpc 2017-05-01 13:52:16 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2017:1191