Bug 745653 - Dependency Calculation takes too long (needs to be revamped)
Summary: Dependency Calculation takes too long (needs to be revamped)
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: WebUI
Version: 6.0.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: Unspecified
Assignee: Tomas Strachota
QA Contact: Garik Khachikyan
URL:
Whiteboard:
Depends On:
Blocks: katello-blockers
TreeView+ depends on / blocked
 
Reported: 2011-10-12 22:20 UTC by Justin Sherrill
Modified: 2019-09-25 21:07 UTC (History)
6 users (show)

Fixed In Version: katello-0.1.96-1.git.15.371d68d
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-08-22 18:01:02 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 747336 0 unspecified CLOSED Performance problems after uploading manifest 2021-02-22 00:41:40 UTC

Internal Links: 747336

Description Justin Sherrill 2011-10-12 22:20:15 UTC
1.  Import a manifest
2.  Create a custom provider, product, repo
3.  Create a changeset and add custom empty product to changeset
4.  Click review changeset

Results:

Dependency calculation takes up to 20 minutes even for an empty repo.


We also have not revamped the dep. calculation to use the new dep. tree that pulp has added.  We also probably want to move this calculation to an async task and store the results in the database.  (We'd need to handle if the user cancels the review as well)

Comment 1 Justin Sherrill 2011-10-13 19:27:28 UTC
So there are few aspects of this issue (which probably span more than this bugzilla):

a) The above situation which takes 20 minutes to calculate the dependencies for an empty repo being promoted.  I'm not sure what is going on here, we need to investigate.  The manifest being imported was the one from october 6th.  It seems to be quite easy to reproduce, as the dependency calculation always takes ~20 minutes.  It should be quite fast when the repo is empty.

b) Previously prad had added some additional functionality that we requested but we haven't gone back and added support for it.  Here is the bug requesting that change: https://bugzilla.redhat.com/show_bug.cgi?id=721134   basically this allows us to 'trim' parts of the dependency tree when a branch is already satisfied by something in the repos of the next environment.

c)  Ideally dependency checking should be done asynchronously when the changeset is moved to the review stage.  So the process would go like this:

  1)  User moves changeset to review phase.
  2)  Dependency task is kicked off as a delayed job
  3)  When dependency calculation is complete, the results are saved in the db (in a table that doesn't currently exist)
  4)  i) When the user promotes a changeset, if the dependency calculation is complete, that can be used for the promotion process  
      ii) If the user promotes a changeset and the dependency calculation is not complete, the promotion task would wait for it to complete before continuing.  
      iii) if the user cancels a review of a changeset, the dependency information is discarded, if a current calculation is in progress it is cancelled.  


Let me know if you have any questions.

Comment 2 Bryan Kearney 2011-10-14 01:47:43 UTC
Tomas:

Can you take a look and let me know if the issue is in kaello.. or in pulp?

Thanks!

-- bk

Comment 3 Tomas Strachota 2011-10-14 07:44:34 UTC
OK, I'll check it.

Comment 4 Tomas Strachota 2011-10-18 14:17:52 UTC
After some debugging it seems that the problem is checking if repositories are cloned to next environment.
After we import manifest, there's around 300 repos that are checked one by one during the dep. calc. => 300 rest calls to pulp. I'm going to do some measurement to prove this theory.

Comment 5 Bryan Kearney 2011-10-18 15:45:00 UTC
Why do we do the depdency check at import? I would think we slam it in and not deal with it.

Comment 6 Tomas Strachota 2011-10-18 18:16:38 UTC
We check it before a changeset promotion. Manifest import was only part of reproduce steps. The problem appeared after we imported the manifest that created 300 repositories.

Comment 23 Tomas Strachota 2011-10-26 09:59:25 UTC
Fixed in f05057e6. Dependency calculations for packages from products or repos included in the changeset are skipped now.

commit f05057e636c6391e22f736a6d0f4d9c5aaeb7399
Author: Tomas Strachota <tstrachota>
Date:   Tue Oct 25 09:13:00 2011 +0200

    dep calc - fixes in displaying the dependencies

Comment 25 Garik Khachikyan 2012-02-15 12:25:01 UTC
# VERIFIED

perfect speed of promoting empty repo (not possible to promote a product without a repo) :)

Having imported a manifest with a repo enabled from there makes no impact on reviewing/promoting another empty repo to the env.

thanks for the fix and the performance shown on there.

checked on:
---
katello-0.1.237-1.git.7.752d8de.el6.noarch
katello-cli-0.1.54-1.git.79.17c365f.el6.noarch
candlepin-0.5.17-1.el6.noarch
pulp-0.0.265-1.el6.noarch


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