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 1384086

Summary: Deleting multiple content hosts can give deadlock in postgres
Product: Red Hat Satellite Reporter: Peter Vreman <peter.vreman>
Component: Hosts - ContentAssignee: Justin Sherrill <jsherril>
Status: CLOSED DUPLICATE QA Contact: Katello QA List <katello-qa-list>
Severity: high Docs Contact:
Priority: high    
Version: 6.2.2CC: bbuckingham, bkearney, brubisch, chrobert, ehelms, isaac.freeman, jcallaha, jentrena, jsherril, xdmoon
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
URL: http://projects.theforeman.org/issues/12556
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1426395 (view as bug list) Environment:
Last Closed: 2017-03-07 16:52:36 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: 1122832, 1426395    
Attachments:
Description Flags
Task content host destroy none

Description Peter Vreman 2016-10-12 13:45:19 UTC
Created attachment 1209620 [details]
Task content host destroy

Description of problem:
Bulk deleting content hosts can trigger a deadlock in postgres.
See attached task export that it deadlocks on the import_data to update the katello_pools.


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. Register 100 Content Hosts
2. Bulk Delete 100 Content Hosts
3.

Actual results:
Deadlock

Expected results:
Success

Additional info:
In the latest upstream the https://github.com/Katello/katello/pull/6187 removes already the finalize() code block that does the import_data() call.

Comment 2 Brad Buckingham 2016-10-14 17:46:38 UTC
Peter, thank you for filing the bugzilla.

Justin, will the PR that Peter has referenced resolve the deadlock observed?

Comment 3 Justin Sherrill 2016-10-17 00:17:06 UTC
Indeed it does.  We likely could backport *just* the piece that would fix it if we want to pull this into 6.2.z

Comment 4 Chris Roberts 2016-10-19 15:20:44 UTC
http://projects.theforeman.org/issues/12556

Comment 5 Peter Vreman 2016-10-21 11:36:07 UTC
This is not just bulk deleting also with re-registering hosts the deadlock is triggered.

E.g. re-register (susbcription-manager register --force) on 10 hosts at the same time.

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

Comment 8 Justin Sherrill 2017-03-07 16:52:36 UTC

*** This bug has been marked as a duplicate of bug 1419985 ***

Comment 9 Justin Sherrill 2017-03-07 16:53:48 UTC
closed as a duplicate as https://bugzilla.redhat.com/show_bug.cgi?id=1419985 already has the single fix we need and not the GIANT upstream change that happened to include it.