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 1679241 - Bulk attaching subscriptions triggers foreman database deadlocks
Summary: Bulk attaching subscriptions triggers foreman database deadlocks
Keywords:
Status: CLOSED INSUFFICIENT_DATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Subscription Management
Version: 6.4.1
Hardware: All
OS: Linux
unspecified
high
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: jcallaha
URL:
Whiteboard:
Depends On:
Blocks: GSS_Sat6Beta_Tracker, GSS_Sat6_Tracker
TreeView+ depends on / blocked
 
Reported: 2019-02-20 16:37 UTC by Julio Entrena Perez
Modified: 2023-03-24 14:35 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-02-17 09:30:49 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Julio Entrena Perez 2019-02-20 16:37:39 UTC
Description of problem:
Bulk attaching subscriptions to a large number of hosts results in foreman database deadlocks on table katello_pools for some of the dynflow tasks.
For example, bulk attaching subscriptions to 150 hosts results in 125 successful tasks and 25 failed tasks with database deadlocks:

2019-02-15 11:07:55 GMT ERROR:  deadlock detected
2019-02-15 11:07:55 GMT DETAIL:  Process 438816 waits for ExclusiveLock on tuple (1,19) of relation 19806 of database 18080; blocked by process 439677.
        Process 439677 waits for ShareLock on transaction 94135696; blocked by process 438814.
        Process 438814 waits for ShareLock on transaction 94136055; blocked by process 438816.
        Process 438816: UPDATE "katello_pools" SET "updated_at" = $1, "consumed" = $2 WHERE "katello_pools"."id" = $3
        Process 439677: UPDATE "katello_pools" SET "updated_at" = $1, "consumed" = $2 WHERE "katello_pools"."id" = $3
        Process 438814: UPDATE "katello_pools" SET "updated_at" = $1, "consumed" = $2 WHERE "katello_pools"."id" = $3
2019-02-15 11:07:55 GMT HINT:  See server log for query details.
2019-02-15 11:07:55 GMT STATEMENT:  UPDATE "katello_pools" SET "updated_at" = $1, "consumed" = $2 WHERE "katello_pools"."id" = $3

Version-Release number of selected component (if applicable):
satellite-6.4.1-1.el7sat

How reproducible:
Always

Steps to Reproduce:
1. Hosts -> Content Hosts -> select 150 hosts -> Select Action -> Manage Subscriptions
2. In Content Host Bulk Subscriptions window, select 4 subscriptions and click Done button.
3. Inspect the resulting tasks and the PostgreSQL logs.

Actual results:
125 hosts have the 4 subscriptions attached to them.
25 hosts fail, 25 "Actions::Katello::Host::AttachSubscriptions" tasks end with warnings, details of the Finalize tab of the dynflow task show database deadlock.

Expected results:
All 150 tasks succeed, all 150 hosts have 4 subscriptions attached, no database deadlocks.

Additional info:


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