Bug 455741 - Performance problem when attempting to remove packages for large number of systems using SSM
Performance problem when attempting to remove packages for large number of sy...
Status: CLOSED CURRENTRELEASE
Product: Spacewalk
Classification: Community
Component: Server (Show other bugs)
0.1
All Linux
low Severity low
: ---
: ---
Assigned To: Michael Mráka
Red Hat Satellite QA List
: Reopened
Depends On:
Blocks: space02
  Show dependency treegraph
 
Reported: 2008-07-17 10:31 EDT by Michael Mráka
Modified: 2009-09-17 02:59 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-09-17 02:59:33 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Michael Mráka 2008-07-17 10:31:46 EDT
Description of problem:
Removing an installed package from ~7.300 systems lasts about 1 hour.
During this period system is unresponsive and heavy load is caused by oracle 
database.

As confirmed by statspack, the offending query is packages_from_server_set 
where it's trying to get a list of all packages from the selected systems.

/usr/lib/perl5/site_perl/5.8.5/RHN/DB/DataSource/xml/Package_queries.xml
...
<mode name="packages_from_server_set">
  <query params="user_id, set_label">
SELECT   PN.ID || '|' || PE.ID AS ID,
         PN.ID AS pn_id,
         PE.ID AS pe_id,
         PN.NAME,
         PE.VERSION,
         PE.release,
         PE.epoch,
         X.num_systems
    FROM rhnPackageName PN,
         rhnPackageEVR PE,
         (SELECT   SP.name_id,
                   SP.evr_id,
                   SP.package_arch_id,
                   COUNT (DISTINCT SP.server_id) num_systems
          FROM     rhnServerPackage SP,
                   rhnSet S,
                   rhnPackageArch PA,
                   rhnArchType AT
          WHERE    s.user_id = :user_id
          AND      s.label = :set_label
          AND      s.ELEMENT = SP.server_id
          AND      (   SP.package_arch_id IS NULL
                      OR EXISTS (
                                 SELECT 1
                                   FROM rhnPackageArch PA,
                                        rhnArchType AT
                                  WHERE PA.id = SP.package_arch_id
                                    AND AT.id = PA.arch_type_id
                                    AND (   AT.label = 'rpm'
                                         OR AT.label =
'sysv-solaris')))
          GROUP BY SP.name_id, SP.evr_id, SP.package_arch_id) X
   WHERE PE.ID = X.evr_id
     AND PN.ID = X.name_id
ORDER BY UPPER (PN.NAME)
  </query>
</mode>
...



Version-Release number of selected component (if applicable):
rhn-base-0.1-3
Comment 1 Michael Mráka 2008-07-17 10:34:13 EDT
More detailed description in private bug 453289.
Comment 2 Michael Mráka 2008-07-17 10:59:55 EDT
Fixed in git.
commit 3d201fa4c794e09fc1cb21d3fc45241964b57477
Comment 4 Miroslav Suchý 2009-09-17 02:59:33 EDT
Spacewalk is released for long time.

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