Bug 1445415

Summary: satellite sync deadlock linking packages to channels
Product: Red Hat Satellite 5 Reporter: Shannon Hughes <shughes>
Component: Satellite SynchronizationAssignee: Grant Gainey <ggainey>
Status: CLOSED ERRATA QA Contact: Martin Korbel <mkorbel>
Severity: medium Docs Contact:
Priority: medium    
Version: 580CC: cshereme, galtukho, ggainey, jdobes, mkorbel, tkasparek, tlestach
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: spacewalk-schema-2.5.1-53-sat satellite-schema-5.8.0.36-1-sat spacewalk-backend-2.5.3-154-sat Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1512922 (view as bug list) Environment:
Last Closed: 2017-12-13 07:58:38 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: 1450111, 1482563, 1512922    

Description Shannon Hughes 2017-04-25 15:42:33 UTC
Description of problem:

deadlock occuring when satellite syncs starts to link the packages to channels. appears to be colliding when a system is engaging in a server snapshot. Will include the following tracebacks. Satellite is in a secure environment so still gathering data. schema is latest at satellite-schema-5.7.0.27-1.el6sat.noarch

postgresql log below ------

2017-04-19 10:38:34.868 MDT DETAIL:  Process 11077 waits for ShareLock on transaction 79341667; blocked by process 10549.
        Process 10549 waits for ShareLock on transaction 79341638; blocked by process 11077.
        Process 11077: SELECT rhn_channel.refresh_newest_package(461, 'satsync.linkPackagesToChannels', NULL)
        Process 10549: SELECT rhn_server.snapshot_server(1000013026, 'Package profile changed')
2017-04-19 10:38:34.869 MDT HINT:  See server log for query details.
2017-04-19 10:38:34.869 MDT CONTEXT:  SQL statement "update rhnChannel
                   set last_modified = greatest(current_timestamp,
                                                last_modified + interval '1 second')
                 where id = channel_id_in"
        PL/pgSQL function rhn_channel.refresh_newest_package(numeric,character varying,numeric) line 21 at SQL statement
2017-04-19 10:38:34.869 MDT STATEMENT:  SELECT rhn_channel.refresh_newest_package(461, 'satsync.linkPackagesToChannels', NULL)

Process 11077 waits for ShareLock on transaction 79341667; blocked by process 10549.
Process 10549: SELECT rhn_server.snapshot_server(1000013026, 'Package profile changed'

--
Process 11077: SELECT rhn_channel.refresh_newest_package(461, 'satsync.linkPackagesToChannels', NULL)
Process 10549: SELECT rhn_server.snapshot_server(1000013026, 'Package profile changed')
--

the following bz might be related, 

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

Comment 10 errata-xmlrpc 2017-12-13 07:58:38 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/RHBA-2017:3445