Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 857963

Summary: Add better transactional support for failed manifest uploads
Product: Red Hat Satellite Reporter: Mike McCune <mmccune>
Component: Subscription ManagementAssignee: Tom McKay <tomckay>
Status: CLOSED CURRENTRELEASE QA Contact: Katello QA List <katello-qa-list>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.0.0CC: jomara, tomckay, wpoteat
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-10-01 14:06:04 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:

Description Mike McCune 2012-09-17 15:26:26 UTC
During CFSE 1.1 we added improved support to rollback an imported manifest with the implementation of a fix in this bug:

https://bugzilla.redhat.com/show_bug.cgi?id=854697

this change only allows for 1 failed manifest import but after that the user is still left in a state that can not be recovered from.  We need additional changes in Katello and Candlepin:

"The changes introduced 'delete' the manifest from candlepin, if the total successful imports is 1 (i.e. this is the first import attempt).  Since katello does not currently store the import history locally, the 'total' is determined by looking at the candlepin history.  The issue we are encountering is essentially the following:

- user sets CDN to invalid value

- user attempts to import a manifest
  - the import of the manifest to candlepin succeeds (history total=1)
  - the creation of repos fails
  - katello deletes the manifest from candlepin (i.e. total == 1)

- user attempts to import a manifest (again)
  - the import of the manifest to to candlepin succeeds (history total=2)
  - the creation of repos fails
  - katello does not delete manifest from candlepin (i.e. total > 1)

- user attempts to import a manifest (again)
  - the import of the manifest to candlepin fails... reason being, it could not
    be deleted on the previous failure, so candlepin reports that this import
    is 'older than existing data'

Unfortunately, katello does not currently have a way with current data to determine on that second failed attempt to delete the manifest.  It is quite possible that first success was a true success, systems were registered, subscribed and are consuming content.  As a result, we cannot simply delete the manifest again, without affecting existing subscriptions.

In order to address this behavior, the following are a couple of things that could potentially help:

1. Update candlepin to destroy the import history for an owner, when a manifest is deleted.  Since the manifest is no longer there, not sure that the history is very useful.  If this was done, in the above scenario the second failed attempt would again delete the manifest from candlepin.

2. Update candlepin to report to katello that the manifest has already been imported (i.e. rather than report 'older than existing data', report 'already imported').  Using this information, katello could be updated to make a decision to continue with the second phase of the import process, which is to create the repositories.  (Note: this is currently on candlepin backlog)

There are likely other solutions; however, posing a couple of possibilities."

Comment 1 William Poteat 2013-10-01 14:06:04 UTC
We have added the ability to update manifests in place. The need to delete the previous manifest to import a new one is gone.

Just import the new-and-improved manifest as needed. Updates will be made in place.

If there is still an issue, please reopen.