Bug 1663214

Summary: PG::TRDeadlockDetected on removing organization
Product: Red Hat Satellite Reporter: Roman Plevka <rplevka>
Component: Subscription ManagementAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED ERRATA QA Contact: jcallaha
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.5.0CC: bkearney, egolov, rplevka
Target Milestone: 6.7.0Keywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: tfm-rubygem-katello-3.14.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-04-14 13:23:48 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:
Attachments:
Description Flags
foreman-debug none

Description Roman Plevka 2019-01-03 12:41:56 UTC
Created attachment 1518133 [details]
foreman-debug

Description of problem:
Destroy Organization task errored out with a deadlock:

<pre>
Couldn't find Organization with 'id'=4 [WHERE "taxonomies"."type" IN ('Organization')]
PG::TRDeadlockDetected: ERROR:  deadlock detected
DETAIL:  Process 9118 waits for ShareLock on transaction 51226; blocked by process 9295.
Process 9295 waits for ShareLock on transaction 50927; blocked by process 9118.
HINT:  See server log for query details.
: DELETE FROM "taxonomies" WHERE "taxonomies"."id" = $1
</pre>

my scenario was:
I had several organizations (5) with subscription manifest attached to each and a rhel7 kickstart repo synced in all of them. I also had the repo in a published content views.

I started to delete the manifests and disabling the rh repos after i deleted the conten views.

- then i started to delete all the custom organiztions, while the only one errored out with the above message.

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

- the attached foreman debug contains the logs with the incident. The incident occurred at 2019-01-03T11:17:18

Comment 3 Brad Buckingham 2019-01-08 18:29:45 UTC
Prior to attempting to delete the org, did the other tasks complete?  (e.g. removal of manifests, disabling repos...etc)

Comment 4 Roman Plevka 2019-01-11 09:12:55 UTC
(In reply to Brad Buckingham from comment #3)
> Prior to attempting to delete the org, did the other tasks complete?  (e.g.
> removal of manifests, disabling repos...etc)

Yes, the satellite was working properly, the tasks completed successfully.
btw, i hit this yesterday again. again I was deleting multiple organizations. I was able to resume the deadlocked task which then finished properly.

Comment 7 Bryan Kearney 2020-01-15 21:00:51 UTC
The Satellite Team is attempting to provide an accurate backlog of bugzilla requests which we feel will be resolved in the next few releases. We do not believe this bugzilla will meet that criteria, and have plans to close it out in 1 month. This is not a reflection on the validity of the request, but a reflection of the many priorities for the product. If you have any concerns about this, feel free to contact Red Hat Technical Support or your account team. If we do not hear from you, we will close this bug out. Thank you.

Comment 9 jcallaha 2020-02-12 16:59:59 UTC
Marking as Verified in Satellite 6.7 Beta, as I'm unable to verify.

I setup 50 Organizations, each with manifests, then looped a deletion of each.

All organizations were successfully deleted, without seeing the error above.

Comment 12 errata-xmlrpc 2020-04-14 13:23:48 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/RHSA-2020:1454