Bug 750932 - Preserve metadata is not functioning on re-sync if source modifies content
Summary: Preserve metadata is not functioning on re-sync if source modifies content
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Update Infrastructure for Cloud Providers
Classification: Red Hat
Component: RHUA
Version: 2.0.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: James Slagle
QA Contact: wes hayutin
URL:
Whiteboard:
Depends On:
Blocks: 750933
TreeView+ depends on / blocked
 
Reported: 2011-11-02 21:08 UTC by John Matthews
Modified: 2012-03-12 19:40 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 750933 (view as bug list)
Environment:
Last Closed: 2012-03-12 19:40:07 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description John Matthews 2011-11-02 21:08:59 UTC
Description of problem:


Scenario is:
1) Initial sync is successful, preserve metadata works
2) Source repo makes some changes, say an errata is deleted
3) Pulp performs a resync
 a) sees errata is deleted or package is removed
 b) createrepo is triggered

Log example below.
I confirmed that this repo was marked as "preserve_metadata":true from mongo.


2011-10-31 14:20:37,782 5129:139946610390784: pulp.server.util:ERROR: util:404 createrepo on /var/lib/pulp//repos/content/dist/rhel/rhui/server/5/5Server/x86_64/os failed
2011-10-31 14:20:37,816 5129:139946610390784: pulp.server.api.synchronizers:ERROR: synchronizers:369 sh: line 1: 16279 Killed                  createrepo --database --checksum sha256 -g /var/lib/pulp//repos/content/dist/rhel/rhui/server/5/5Server/x86_64/os/repodata/87b78cae8caf76f232374d6a8f8392b8c7fb0239-comps-rhel-x86_64-server-5.xml --update /var/lib/pulp//repos/content/dist/rhel/rhui/server/5/5Server/x86_64/os
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/pulp/server/api/synchronizers.py", line 363, in sync_updateinfo_data
    repo_api.delete_erratum(repo['id'], e['id'])
  File "/usr/lib/python2.6/site-packages/pulp/server/api/repo.py", line 1073, in delete_erratum
    self._update_errata_packages(repoid, [erratumid], action='delete')
  File "/usr/lib/python2.6/site-packages/pulp/server/api/repo.py", line 1044, in _update_errata_packages
    self.remove_packages(repo['id'], rmids)
  File "/usr/lib/python2.6/site-packages/pulp/server/api/repo.py", line 963, in remove_packages
    pulp.server.util.create_repo(repo_path, checksum_type=repo["checksum_type"])
  File "/usr/lib/python2.6/site-packages/pulp/server/util.py", line 421, in create_repo
    _create_repo(dir, groups=groups, checksum_type=checksum_type)
  File "/usr/lib/python2.6/site-packages/pulp/server/util.py", line 405, in _create_repo
    raise CreateRepoError(out)
CreateRepoError: sh: line 1: 16279 Killed                  createrepo --database --checksum sha256 -g /var/lib/pulp//repos/content/dist/rhel/rhui/server/5/5Server/x86_64/os/repodata/87b78cae8caf76f232374d6a8f8392b8c7fb0239-comps-rhel-x86_64-server-5.xml --update /var/lib/pulp//repos/content/dist/rhel/rhui/server/5/5Server/x86_64/os

Comment 1 James Slagle 2011-12-08 19:41:51 UTC
patch has already been applied to the rhui branch, just needs to be released.

commits:
7db220abfbd9aaedc6c018c7fd611b2794d195f8
85e71183be14ccf5b0e533396591c2fa79223b1f

Comment 2 James Slagle 2012-02-03 12:17:50 UTC
QA:
After each repo sync, you should need so processes of createrepo running.

Comment 3 James Slagle 2012-02-20 14:15:22 UTC
Sorry, realize I typo'd my previous comment.  It should read:

"you should not see any processes of createrepo running"

The idea here is that the source has the correct metadata that has been updated to reflect the change in the repository.  Since pulp copies the metadata during a sync operation, there is no need for pulp to regenerate the metadata, thus you should never see createrepo running.

Comment 4 Kedar Bidarkar 2012-02-20 14:53:21 UTC
Ah! then in that case, as none of the logs show that the createrepo command has run, moving this to verified state.

Comment 5 James Slagle 2012-03-02 16:38:29 UTC
Since this bug affects 2.0 and 2.0.1, we've decided to backport those patches and release a hotfix.

new pulp packages for 2.0.1 are at:
https://brewweb.devel.redhat.com/buildinfo?buildID=201381

Comment 6 James Slagle 2012-03-12 19:40:07 UTC
Released in RHUI 2.0.2


Note You need to log in before you can comment on or make changes to this bug.