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.